Author Topic: TH2830 vs TH2832  (Read 53929 times)

0 Members and 5 Guests are viewing this topic.

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27331
  • Country: nl
    • NCT Developments
Re: TH2830 vs TH2832
« Reply #50 on: June 28, 2023, 09:23:28 pm »
What do you think about simply overwriting the contents of the chips with the ones from a 2832 ?
I think the device ID is in the external FRAM. I think the firmware consists of 3 parts: the LPC1788 firmware, some kind of look-up table that goes into the flash and the FPGA image.
In other words: you will not be overwriting the device ID with overwriting the contents of the chips. I'm quite sure the firmware update process already takes care of that. We need to call in forum member tv84 to take a look.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: Martin72

Offline tv84

  • Super Contributor
  • ***
  • Posts: 3260
  • Country: pt
Re: TH2830 vs TH2832
« Reply #51 on: June 28, 2023, 10:02:05 pm »
We need to call in forum member tv84 to take a look.

He has...  :)

What is that makes these devices so special?

Just loading with a totally random address, we can see plenty of code (ARM little endian). Don't know what you're trying to accomplish but Nico's inference to read the FRAM (if it has one) seems the best way.

Edit: Added a picture (code graph) that show the different models involved... looks like there are lots of them.
« Last Edit: July 01, 2023, 08:19:00 pm by tv84 »
 
The following users thanked this post: nctnico, egonotto, KungFuJosh, Martin72, zrq

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #52 on: June 28, 2023, 11:03:50 pm »
It looks like the firmware image has 3 chunks and these are seperated by a header containing a text string 'B9FZI'

That only appears in the 2830 firmware. Did you find something similar in the 2832?
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #53 on: June 28, 2023, 11:10:04 pm »
We need to call in forum member tv84 to take a look.

He has...  :)

What is that makes these devices so special?

Just loading with a totally random address, we can see plenty of code (ARM little endian). Don't know what you're trying to accomplish but Nico's inference to read the FRAM (if it has one) seems the best way.

Edit: Added a picture (code graph) that show the different models involved... looks like there are lots of them.

😇

I dunno, they're well made I guess? 😉

The goal is to get the features being blocked by the firmware; primarily an increase in frequency range, and a DC bias voltage function.

It is funny how many models are mentioned. Even in the plain text many are listed:
TH2830N TH2832X ST2832X TH2830L TH2832  ST2832  SM6024  eWK6302BQ   TH7832  9216B   JDI1022 TH7832A AMM3046 LCR2200 LN2020  TH2831  ST2831  M2831B  XTD4510 DHK6200 TX6200  AMM3044 TH2830  ST2830  SM6023  DHK6100 JCX860  TX6100  TH7830  TH2816D OCT1010 TH2830HY LCR2100


The TECPEL LCR-2100 looks like another 2830 clone, currently $700 on Amazon.
« Last Edit: June 28, 2023, 11:12:02 pm by KungFuJosh »
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27331
  • Country: nl
    • NCT Developments
Re: TH2830 vs TH2832
« Reply #54 on: June 28, 2023, 11:18:11 pm »
It looks like the firmware image has 3 chunks and these are seperated by a header containing a text string 'B9FZI'

That only appears in the 2830 firmware. Did you find something similar in the 2832?
I see it in all firmware files... I = letter I, not number!

BTW: I see the LPC1788 also has an internal EEPROM that may also hold information about the model.
« Last Edit: June 28, 2023, 11:38:33 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #55 on: June 29, 2023, 12:25:22 am »
It looks like the firmware image has 3 chunks and these are seperated by a header containing a text string 'B9FZI'

That only appears in the 2830 firmware. Did you find something similar in the 2832?
I see it in all firmware files... I = letter I, not number!

BTW: I see the LPC1788 also has an internal EEPROM that may also hold information about the model.

Oops, my bad. WinMerge is goofy on the search function sometimes (even thought it was really a PEBKAC error). 😉
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27331
  • Country: nl
    • NCT Developments
Re: TH2830 vs TH2832
« Reply #56 on: June 29, 2023, 08:56:53 am »
We need to call in forum member tv84 to take a look.

He has...  :)

What is that makes these devices so special?
These are nice LCR meters for a reasonable price.

Judging from your call-graph, it seems there is a value stored somewhere that says which model it is and after that some kind of text comparison is made. It would be nice to figure out where this is stored and maybe how the model type is set.
« Last Edit: June 29, 2023, 09:09:43 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online Martin72

  • Super Contributor
  • ***
  • Posts: 6266
  • Country: de
  • Testfield Technician
Re: TH2830 vs TH2832
« Reply #57 on: June 29, 2023, 04:15:24 pm »
Silly question,
Which program is used to generate this information from the previously posted hex file ?
I would also like to have a look at it.
"Comparison is the end of happiness and the beginning of dissatisfaction."
(Kierkegaard)
Siglent SDS800X HD Deep Review
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 6211
  • Country: ca
Re: TH2830 vs TH2832
« Reply #58 on: June 29, 2023, 04:40:09 pm »
Ida dissasembler  or  ghidra ...

some free, some cost a fortune  loll

https://mohamad-wael.medium.com/best-microsoft-windows-disassemblers-and-decompilers-6fdfbf9990de
 

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #59 on: June 29, 2023, 04:42:34 pm »
Judging from your call-graph, it seems there is a value stored somewhere that says which model it is and after that some kind of text comparison is made.

That seems likely, but it's interesting that there's nothing that blocks use of the same level firmware from different branding. My TH2830 is currently running the ST2830 firmware. It appears they only care about the 2830 part.
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27331
  • Country: nl
    • NCT Developments
Re: TH2830 vs TH2832
« Reply #60 on: June 29, 2023, 04:45:59 pm »
It looks like the model information is a model ID number (which may be used at other locations in the firmware as well to determine the abilities of the hardware) AND a text with the model number. Your experiment to load different firmware likely failed due to the model ID number being wrong.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: KungFuJosh

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #61 on: June 29, 2023, 05:00:54 pm »
It looks like the model information is a model ID number (which may be used at other locations in the firmware as well to determine the abilities of the hardware) AND a text with the model number. Your experiment to load different firmware likely failed due to the model ID number being wrong.

If we can figure out what the reference model ID numbers are for both devices, maybe we can modify the firmware to allow the 2832 fw on the 2830?
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 3260
  • Country: pt
Re: TH2830 vs TH2832
« Reply #62 on: June 29, 2023, 05:16:23 pm »
It looks like the model information is a model ID number (which may be used at other locations in the firmware as well to determine the abilities of the hardware) AND a text with the model number. Your experiment to load different firmware likely failed due to the model ID number being wrong.

You may be correct although from what I conclude from the "call-graph" it seems the decision flag is the model name. But, to be honest, I didn't think much about it.

And, it seems that there are plenty of model names that end up in the same few "real" models.

If the thing has a FRAM, please dump the FRAM.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27331
  • Country: nl
    • NCT Developments
Re: TH2830 vs TH2832
« Reply #63 on: June 29, 2023, 06:26:39 pm »
It looks like the model information is a model ID number (which may be used at other locations in the firmware as well to determine the abilities of the hardware) AND a text with the model number. Your experiment to load different firmware likely failed due to the model ID number being wrong.

You may be correct although from what I conclude from the "call-graph" it seems the decision flag is the model name. But, to be honest, I didn't think much about it.
Not really. The 2nd check is just for the right model name. At the top of the graph the decision goes into 3 columns for the 3 different base models (2830, 2831 and 2832). After that decision, there is a text comparison as a 2nd check.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 3260
  • Country: pt
Re: TH2830 vs TH2832
« Reply #64 on: June 29, 2023, 08:19:50 pm »
After that decision, there is a text comparison as a 2nd check.

You're right. So, it's something like this:

Model_byte (in hex):
Ax - TH2830 / ST2830 / SM6023 / DHK6100 / JCX860 / TX6100 / TH7830 / TH2816D / OCT1010 / TH2830HY
Bx - TH2831 / ST2831 / M2831B / XTD4510 / DHK6200 / TX6200 / AMM3044
Cx - TH2832 / ST2832 / SM6024 / eWK6302BQ / TH7832 / 9216B / JDI1022 / TH7832A / AMM3046
Dx - TH2830L
Ex - TH2832X / ST2832X
Fx - TH2830N

If these combinations don't match, the FW will show "Wrong Firmware!" msg.

So now you can do some FRAM/EEPROM analysis...
« Last Edit: June 29, 2023, 08:30:38 pm by tv84 »
 

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #65 on: June 29, 2023, 09:08:18 pm »
After that decision, there is a text comparison as a 2nd check.

You're right. So, it's something like this:

Model_byte (in hex):
Ax - TH2830 / ST2830 / SM6023 / DHK6100 / JCX860 / TX6100 / TH7830 / TH2816D / OCT1010 / TH2830HY
Bx - TH2831 / ST2831 / M2831B / XTD4510 / DHK6200 / TX6200 / AMM3044
Cx - TH2832 / ST2832 / SM6024 / eWK6302BQ / TH7832 / 9216B / JDI1022 / TH7832A / AMM3046
Dx - TH2830L
Ex - TH2832X / ST2832X
Fx - TH2830N

If these combinations don't match, the FW will show "Wrong Firmware!" msg.

So now you can do some FRAM/EEPROM analysis...

That sounds like it's a simple function in the firmware to halt loading if the combination doesn't match. Is that correct? Can we defeat that in the firmware? For example: firmware says 2832, but right now the model byte says Ax, so it says wrong firmware. Can we change the definition of Ax to match 2832?
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 3260
  • Country: pt
Re: TH2830 vs TH2832
« Reply #66 on: June 29, 2023, 09:18:42 pm »
That sounds like it's a simple function in the firmware to halt loading if the combination doesn't match. Is that correct? Can we defeat that in the firmware? For example: firmware says 2832, but right now the model byte says Ax, so it says wrong firmware. Can we change the definition of Ax to match 2832?

I can but can you flash it without a programmer? (and hope that it doesn't verify any checksum while running...)

Edit: Attached is the FW with A0 and C0 bytes swapped, as requested. Have no idea if that will work. In logic terms I would say that you should be already running this precise patched version in order to accept a... patched version. :)

Edit2: The file was wrong! A correct one is in a following msg.
« Last Edit: June 30, 2023, 09:53:32 pm by tv84 »
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27331
  • Country: nl
    • NCT Developments
Re: TH2830 vs TH2832
« Reply #67 on: June 29, 2023, 09:42:14 pm »
I'm pretty sure that it will end up as 'Wrong firmware'. You'd need to change the text that is being tested as well. If all the tests for the right model name fail, the graph goes into 'Wrong firmware'.
 
What puzzles me is why the firmware doesn't run on Josh' ST2830 while it is supposed to support that model. This seems to suggest that the model name might be derived from the firmware file that is being loaded. Maybe, just maybe changing the firmware filename to ST2832 already makes the file work as the model ID and model name now match. But I doubt the features of the ST2832 are enabled. I don't see any signs of the model ID being used to set a flag for the functionality in the call graph that TV84 has posted.
« Last Edit: June 29, 2023, 09:49:56 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #68 on: June 29, 2023, 09:59:06 pm »
That sounds like it's a simple function in the firmware to halt loading if the combination doesn't match. Is that correct? Can we defeat that in the firmware? For example: firmware says 2832, but right now the model byte says Ax, so it says wrong firmware. Can we change the definition of Ax to match 2832?

I can but can you flash it without a programmer? (and hope that it doesn't verify any checksum while running...)

Edit: Attached is the FW with A0 and C0 bytes swapped, as requested. Have no idea if that will work. In logic terms I would say that you should be already running this precise patched version in order to accept a... patched version. :)

Unfortunately no, that didn't work. It didn't get past 5%, so it seems it fails some kind of precheck.

Renaming ST2832 to ST2830 will allow it to fully flash the stock firmware, it's when you try to run the meter that it fails after that.

Edit: Attached is two screenshots comparing the beginning of the stock fw files, and the modified one. There's something missing with the modified version.
« Last Edit: June 29, 2023, 10:49:10 pm by KungFuJosh »
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #69 on: June 29, 2023, 10:01:33 pm »
I'm pretty sure that it will end up as 'Wrong firmware'. You'd need to change the text that is being tested as well. If all the tests for the right model name fail, the graph goes into 'Wrong firmware'.
 
What puzzles me is why the firmware doesn't run on Josh' ST2830 while it is supposed to support that model. This seems to suggest that the model name might be derived from the firmware file that is being loaded. Maybe, just maybe changing the firmware filename to ST2832 already makes the file work as the model ID and model name now match. But I doubt the features of the ST2832 are enabled. I don't see any signs of the model ID being used to set a flag for the functionality in the call graph that TV84 has posted.

The firmware files aren't the same though. For whatever reason, the 2830 fw file is actually 2k larger than the 2832. I think (am guessing) the fw itself contains what we need for those functions to work. They don't need to flag for individual functions if the fw won't let you get past startup.

My hardware model is the TH2830, currently being run as an ST2830.
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #70 on: June 30, 2023, 06:18:29 pm »
Attached is the FW with A0 and C0 bytes swapped, as requested.

Are those swapped in the hex file, or did you decompile / recompile?

On a quick search A0 (41 30) appears in both hex files exactly 12 times. C0 (43 30) appears in 2830 two times, and in 2832 seven times.
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 3260
  • Country: pt
Re: TH2830 vs TH2832
« Reply #71 on: June 30, 2023, 09:16:13 pm »
Attached is the FW with A0 and C0 bytes swapped, as requested.

Are those swapped in the hex file, or did you decompile / recompile?

On a quick search A0 (41 30) appears in both hex files exactly 12 times. C0 (43 30) appears in 2830 two times, and in 2832 seven times.

Do a binary comparison between the files and you'll understand what I did. I just swapped the ones involved in that call-graph shown. Just as a proof-of-concept with no deep analysis behind.
 

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #72 on: June 30, 2023, 09:29:58 pm »
Do a binary comparison between the files and you'll understand what I did. I just swapped the ones involved in that call-graph shown. Just as a proof-of-concept with no deep analysis behind.

I did a binary comparison in a hex editor (WinMerge), and the files are significantly different. Attached is a partial comparison of the patched fw and the stock fw (left side is stock, right side is patched).

Am I supposed to compare them a different way?
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 3260
  • Country: pt
Re: TH2830 vs TH2832
« Reply #73 on: June 30, 2023, 09:45:02 pm »
Sorry, Josh.   :-[

I messed up big!  |O |O  That's what results when doing things in a hurry.

This is the correct patched file (with A0 and C0 swapped). Try this one.

Edit: This file had incorrect checksums. See my following messages where I share this file with correct checksums.
« Last Edit: July 01, 2023, 08:17:30 pm by tv84 »
 
The following users thanked this post: KungFuJosh

Online KungFuJoshTopic starter

  • Super Contributor
  • ***
  • Posts: 1955
  • Country: us
  • TEAS is real.
Re: TH2830 vs TH2832
« Reply #74 on: June 30, 2023, 10:18:31 pm »
Sorry, Josh.   :-[

I messed up big!  |O |O  That's what results when doing things in a hurry.

This is the correct patched file (with A0 and C0 swapped). Try this one.

No worries my friend, I always appreciate your help!

However, are you sure that's the right file? It appears to be identical to the ST2832 stock file? I mapped the location of those references, and they are still the same:

2830 A0 (41 30) Appears:
000010
005ba0
010590
03b570
03b5f0
04e6c0
0525a0
0579c0
0ecd20
187850
1a3640
1bdba0

2830 C0 (43 30) Appears:
082170
19b270

2832 A0 (41 30) Appears:
000010
0058e0
00fb00
03af50
03afc0
04dc00
056b80
0779f0
0ec4f0
187030
1a2e10
1bd370

2832 C0 (43 30) Appears:
003fc0
0058f0
0075c0
007700
081940
175c70
19aa40

Edit: okay, something is different, the update failed instead of finishing and saying wrong firmware. The A0s were all the same, I'll check the C0s. Edit again: C0 also at the same lines. I didn't see anything different otherwise, so I don't know why it failed. 🤷
« Last Edit: June 30, 2023, 10:22:05 pm by KungFuJosh »
"I installed a skylight in my apartment yesterday... The people who live above me are furious." - Steven Wright
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf