Merge your own dump.bin with a FULL firmware

Support requests for wrong Fw uptading and ressurection of dead players.

Merge your own dump.bin with a FULL firmware

Postby JedOi » Wed Feb 15, 2006 1:55 am

OK ... you made a backup of your firmware with s1fwx and repaired it before your player went wrong ...

Now your player is in ADFU (recovery mode) but when you try to use your backed up "dump.bin" file to recover your player you get the message "Invalid firmware upgrade file!"

Image

This is because your player will ONLY accept a FULL firmware file when it is in ADFU recovery mode.

The usual method of trying to fix this is to go through the list of firmwares on the firmware list and in the firmware archive until you find one (hopefully) that will get your player out of ADFU mode and back into USB Mass Storage mode.

Only when your player is back in USB Mass Storage mode can you flash your backed up and repaired "dump.bin".

Another way to go about this is to find the most suitable FULL file from the list or the archive and then to merge your own backed up "dump.bin files into that full firmware file.

This is probably a better way to go as using the first method could possibly install a firmware which causes your players functions to screw up in such a way as to make it difficult to continue flashing other firmwares eg. your player may constantly restart never giving your "MP3 Player Update Tool" chance to connect.

Neither method is completely foolproof but for any of you that wish to try the merging method, I have made a simple batch file to do the merging for you.

All you need to do is to put s1fwx.exe, merge.bat, your dump.bin and a suitable FULL firmware file (renamed to full.bin) into the same folder and run merge.bat ...

Image

merge.bat will repair your dump if it needs it, extract all of the files from full.bin then extract all of the files from your dump.bin automatically overwriting the matching files from the full file ... it will then make a new FULL file called "merged.bin" which will be your original dump.bin files grafted into the FULL file ... finally it will delete all of the confusing files from the various operations.

You can download merge.bat from HERE

Or ... make the batch file yourself by copying the following code into a .txt document then renaming it to merge.bat

Code: Select all
@echo off

::try to repair dump if needed
s1fwx r dump.bin

::make script from full.bin to recompile from
s1fwx s full.bin > merge.script

::extract files from the full.bin
s1fwx x full.bin

::extract files from dump.bin overwriting files extracted from full.bin
s1fwx x dump.bin

::rebuild full firmware with files from dump.bin included
s1fwx a merged.bin:afi < merge.script

::delete surplus files
for %%t in (dump full merged) do ren %%t.bin *.bak
for %%t in (script ap fw bin bi$) do del *.%%t
ren *.bak *.bin


(credits to ~J-@Ð!~ for optimization)

Hope this helps someone ;)
Last edited by JedOi on Fri Apr 07, 2006 4:15 am, edited 4 times in total.
User avatar
JedOi
Moderator
Moderator
 
Posts: 582
Joined: Tue Oct 25, 2005 4:47 am
Location: UK

Postby wladston » Wed Feb 15, 2006 2:31 pm

JedOi,

GREAT post ...

Why don't you put this on the wiki ?? me thinks it's best ...

Also remember you can upload files to the s1mp3.org server via the ADM page!!
1GB Standard s1 mp3 player. (MP-482C MAIN V8)
1GB "mp4" s1mp3 player. Not remarked.
I DO __NOT__ reply to PM's. Send email instead. I won't be even notified for new PM's.
User avatar
wladston
Site Admin
Site Admin
 
Posts: 1721
Joined: Tue Aug 23, 2005 8:54 pm
Location: Belo Horizonte, MG - Brazil

Re: Merge your own dump.bin with a FULL firmware

Postby ~J-@Ð!~ » Thu Feb 16, 2006 3:57 am

JedOi wrote:
Code: Select all
@echo off

# try to repair dump if needed
s1fwx r dump.bin

# make script from full.bin to recompile from
s1fwx s full.bin > merge.script

# extract all files from the full.bin
s1fwx x full.bin

# extract files from dump.bin overwriting files extracted from full.bin
s1fwx x dump.bin

# rebuild full firmware with files from dump.bin included
s1fwx a merged.bin:afi < merge.script

# delete surplus files
ren dump.bin dump.bak
ren full.bin full.bak
ren merged.bin merged.bak
del *.script
del *.ap
del *.fw
del *.bin
del *.bi$
ren *.bak *.bin



You are using "#" as a rem on the batch file ... I don't know if it is compatible Win 98! If you use 2 semi-colons ( :: ) or even percent sign (%, one too at the end of the line) it will work on any version of DOS. Also, using FOR commands, I can save some bytes in your batch file :P . BTW Wladston, it is now 1 month and 10 days ago that I sent to wiRe my mail about my 2 batch files , and I didn't get an answer from him! So do what you want with them (they are on the server, in Bfiles.7z).
Take a look of my hot boot/bye animations:
Image Image
Go to Gallery section you Kirby lovers ;)!
___
ZD 0411 Ver 1.2 LAURA, 512MB, 7 colours, no FM
User avatar
~J-@Ð!~
S1mp3 (and Kirby) lover
 
Posts: 163
Joined: Sat Nov 26, 2005 6:28 pm
Location: Québec!!!

Postby JedOi » Thu Feb 16, 2006 4:07 am

Excellent, if you can optimise it then please do ~J-@D!~ :D

What do your batch files do ~J-@D!~ ?

PS. don't think I have access to ADM page :(
User avatar
JedOi
Moderator
Moderator
 
Posts: 582
Joined: Tue Oct 25, 2005 4:47 am
Location: UK

Postby ~J-@Ð!~ » Sat Feb 18, 2006 9:37 pm

Optimization of the batch file:

Code: Select all
@echo off
::try to repair dump if needed
s1fwx r dump.bin
::make script from full.bin to recompile from
s1fwx s full.bin > merge.script
::extract files from the full.bin
s1fwx x full.bin
::extract files from dump.bin overwriting files extracted from full.bin
s1fwx x dump.bin
::rebuild full firmware with files from dump.bin included
s1fwx a merged.bin:afi < merge.script
::delete surplus files
for %%t in (dump full merged) do ren %%t.bin *.bak
for %%t in (script ap fw bin bi$) do del *.%%t
ren *.bak *.bin


my batch files: http://www.s1mp3.org/files/BFiles.7z

They perform extracting and combining files with some error protection (foolproof) :D
Take a look of my hot boot/bye animations:
Image Image
Go to Gallery section you Kirby lovers ;)!
___
ZD 0411 Ver 1.2 LAURA, 512MB, 7 colours, no FM
User avatar
~J-@Ð!~
S1mp3 (and Kirby) lover
 
Posts: 163
Joined: Sat Nov 26, 2005 6:28 pm
Location: Québec!!!

Postby JedOi » Sun Feb 19, 2006 7:52 am

Excellent, & thanks for the tutorial too ~J-@D!~ m8 ;)
User avatar
JedOi
Moderator
Moderator
 
Posts: 582
Joined: Tue Oct 25, 2005 4:47 am
Location: UK

Postby mallu boy » Sun Feb 19, 2006 1:26 pm

I tried it. Merged m600.bin with the dump.bin which made my player work.

The resulting merged.bin did not get my player working when it was in ADFU mode - I loaded it with a wrong firmware to check it.

But loading m600.bin gets it working as a flash disk. Loading dump.bin after it is working as a flash disk gets it fully operational.

Maybe I should try merging it with a different full firmware?
s1 mp3 player stickered 256 mb, actually 128 with 2005.08.28 board, atj2051 - now 1000 Mb after chip replacement. Instructions on soldering memory chips here: viewtopic.php?f=3&t=1592&st=0&sk=t&sd=a&start=23
mallu boy
 
Posts: 21
Joined: Fri Feb 10, 2006 4:07 am
Location: Thiruvananthapuram

Postby JedOi » Sun Feb 19, 2006 2:09 pm

Did you rename m600.bin to full.bin as in the example before merging ?
User avatar
JedOi
Moderator
Moderator
 
Posts: 582
Joined: Tue Oct 25, 2005 4:47 am
Location: UK

Postby mallu boy » Tue Feb 21, 2006 11:24 am

Yes, of course.

I tried merging the dump with various other firmwares but with no success. My player works, so after each trial updation there is always the chance that a corrupt boot record might kill it permanently.

So far, I have been able to get it back again by loading m600.bin followed by the dump.bin and that is the only procedure to get it working again.
s1 mp3 player stickered 256 mb, actually 128 with 2005.08.28 board, atj2051 - now 1000 Mb after chip replacement. Instructions on soldering memory chips here: viewtopic.php?f=3&t=1592&st=0&sk=t&sd=a&start=23
mallu boy
 
Posts: 21
Joined: Fri Feb 10, 2006 4:07 am
Location: Thiruvananthapuram

Postby JedOi » Tue Feb 21, 2006 11:47 am

Well if mp600.bin gets the player to boot as a "Mass Storage Device" and then your dump.bin gets all of the functionality back correctly ...

Merging your dump.bin into the mp600.bin (renamed to full.bin just for the merge process) should give you a FULL file (merged.bin) which will flash AND give the correct functionality all in one go ...

If this isn't the case then something is probably going wrong in the merge. You (or I) could add pauses into the merge.bat to see what's happening one step at a time.
User avatar
JedOi
Moderator
Moderator
 
Posts: 582
Joined: Tue Oct 25, 2005 4:47 am
Location: UK

Postby mallu boy » Wed Feb 22, 2006 7:51 am

I think I shall extract the two firmwares and then go inside the bits which turn out to be different with a hex editor. Shall report back if I find anything significant.
s1 mp3 player stickered 256 mb, actually 128 with 2005.08.28 board, atj2051 - now 1000 Mb after chip replacement. Instructions on soldering memory chips here: viewtopic.php?f=3&t=1592&st=0&sk=t&sd=a&start=23
mallu boy
 
Posts: 21
Joined: Fri Feb 10, 2006 4:07 am
Location: Thiruvananthapuram

Postby Roeoender » Fri Mar 10, 2006 8:01 pm

To be 100% precize proper way to comment in DOS batch files is to use "rem" command, like this:
Code: Select all
@echo off
rem This is a comment
echo Hello World


Colon (only one is needed) is used to create labels so you can use "goto" to jump to label, like this:
Code: Select all
echo This is executed
goto somewhere
echo This won't be executed
:somwhere
echo This will be executed


Hope this helps
Roeoender
 
Posts: 8
Joined: Wed Mar 08, 2006 9:48 am
Location: Poland

Postby ian_hawdon » Sat Mar 11, 2006 7:06 pm

The next time i get my copy of QuickBasic 7.1 out, ill try and make (and compile) an advanced version of the file :D
Who is General Error and why is he reading my hard drive? :D

If any of my posts have helped you, or if you're interested, click this link and sign up to help me get a free iPhone: http://apple.real-incentives.com/40461
User avatar
ian_hawdon
Site Admin
Site Admin
 
Posts: 978
Joined: Wed Aug 24, 2005 7:00 pm
Location: Newcastle Upon-Tyne, England

Postby ~J-@Ð!~ » Sat Mar 11, 2006 10:23 pm

@Roeoender , man, don't tell me what to do, will you? I know enough DOS to ignore that kind of tip, because it acts the same. Tom Lavedas do the same. Watch out attentively
Take a look of my hot boot/bye animations:
Image Image
Go to Gallery section you Kirby lovers ;)!
___
ZD 0411 Ver 1.2 LAURA, 512MB, 7 colours, no FM
User avatar
~J-@Ð!~
S1mp3 (and Kirby) lover
 
Posts: 163
Joined: Sat Nov 26, 2005 6:28 pm
Location: Québec!!!

Postby Roeoender » Sun Mar 12, 2006 12:28 pm

What advantage in this batch script gives using undocumented and obscure feature of "::" over using documented and widely known since BASIC times command "rem"?

Even if this behaviour is supported by every M$ OS since DOS 1.0 you can't be sure it will work on future OSes.

The funny thing is that main role of comments is to help readers to know what is going on, using "::" you do just the opposite :-).
Roeoender
 
Posts: 8
Joined: Wed Mar 08, 2006 9:48 am
Location: Poland

Next

Return to Wrong Fw update/ Recover dead devices

Who is online

Users browsing this forum: Bing [Bot] and 1 guest



cron