[MDA II, XDA II, 2060 ROM Development] dcs:
IMPORTANT: Updated 28th September - I now know that if you have bootloader v1.06 on your XDA II, you cannot downgrade your ROM :( (at the moment). We will see if we can find a way round this but cannot promise anything.

Hi everyone!

Just wanted to share the experiences/conclusions with upgrading my XDA II ROM with you all.

I have split this into two posts for ease of reading and clarity. This post is the first of the two and contains the background and conclusions. The next post contains the solution (hopefully) and can be found here:

Fix and prevent ROM upgrade/downgrade Country ID errors

So the impatient ones amongst you can skip straight to it if you wish :), although it is best to read this post first.

Background

Some months ago, I bought my XDA II which had the 1.03 USA ROM in it and shortly afterwards, successfully upgraded it to the latest official release from O2 (1.60.50WWE), using their supplied executable package Xda_II_Upgrade_v16050.exe obtained from

here

.

Last week I upgraded to the i-mate 1.72.00WWE version using the .nbf files and HimaUpgradeUt utilities extracted from the RUU172126WWE_imate.exe executable supplied in

this post

.

I configured the .nbf files for operator O2 and language WWE using softworkz ER2003Edit tool obtained from

here

.

The upgrade went smoothly enough - all seemed well, so last week-end, fired up by this success, my friend came over (merlin_uk on this forum) and wanted to upgrade his XDA II to the same version, but containing the 1.17.00 radio, using the files extracted from the UK02-172WWE.zip file obtained from

here

.

These .nbf files were already configured for operator O2 and language WWE.

I decided to do the same. merlin_uk upgraded with no problems, but I hit the notorious 'Country ID' error :shock:. This didn't make sense, so I tried re-running the exact same upgrade I had done the day before and it also reported Country ID error. merlin_uk re-ran the upgrade he had JUST performed and it also reported Country ID error. Something strange was afoot :?.

We looked at the information in the DeviceData.txt file produced on the device by the HimaGetDeviceData utility used by the upgrade process and saw that the operator was specified as 'CDL' even though we had configured 'O2' as the operator in the .nbf file headers. We therefore suspected that the XDA had become a 'CDL' device somehow. To confirm this I ran the i-mate upgrade without changing the headers to 'O2' so they were set to 'CDL' and it got past the initial check and would have continued if I had chosen to do so.

Now we were on a quest :evil: - something OTHER than the information specified in the headers was setting the XDA's operator code to 'CDL'. Our first thought was that it was the upgrade program itself.

We spent the next 15 hours or so using disassemblers, etc. to look at the HimaUpgradeUt.exe program trying to see where it was doing it. We even managed to get past the initial check, thanks to merlin_uk, by forging the DeviceData.txt file on the device (produced by HimaGetDeviceData) and setting it to read-only, but it still failed when trying to do the upgrade itself. At 6am we had to stop (work committments got in the way :) ).

Yesterday, I continued the quest and turned my attention to the .nbf ROM images instead. Eventually I found the problem. There is an extra block of information contained in the Operators ROM (ms_.nbf) image just after the nbf header. This extra block contains a language code and an operators code - and guess what? - yeh you got it - it specified 'CDL' as the operator code! EUREKA!! nailed it at last :D This extra block is documented in the ROM layouts described

here

.

I then manipulated the ms_.nbf file so that the nbf header contained 'CDL' as the operator (to match the DeviceData.txt) and so that the extra block contained 'O2' as the operator (to match what my operator should be) I ran the upgrade and it ran successfully :D.

Predicting that my XDA II was now back to being an 'O2' device, I ran it again immediately, and it failed with Country ID error. This confirmed everything. I then reconfigured the nbf header to operator 'O2', ran the upgrade again and voila, I have a 1.172WWE O2 XDA II. :D:D:D:D.

Since then, purely for experimentation, I have downgraded to the original O2 1.60.00 release and upgraded back again.

Conclusions

The information specified in the extra block of data in the operators ROM image (ms_.nbf) is used to set the device/operator/language in the device. It doesn't need to match what the device is set to already. It is this information which HimaGetDeviceData will retrieve at the beginning of any subsequent upgrade and return via the DeviceData.txt file. I assume it is updated to the new values towards the end of the upgrade process.

The information specified in the nbf headers of all the ROM images (NK.nbf, ms_.nbf and Radio_.nbf) is used to set the device/operator/language in the software of the device. It must match the device/operator/language currently specified in the device.

Neither the ER2003Edit tool nor xda2nbftool, obtained

here

, update the extra block of data in the ROM image.

The limitation of not being able to downgrade does not exist in any devices with bootloader versions earlier than v1.06. The limitation was caused by the device operator code being unwittingly updated to a 'wrong' value, which affected any further attempts to upgrade. Devices with bootloader v1.06 cannot downgrade, even if the operator code is correct.

The Country ID error could be a thing of the past, as long as anyone upgrading checks and amends, if necessary, the information contained in the extra block of data in the operators ROM before performing the upgrade. This should be done even if the nbf headers are already correctly configured.

In my next post I describe the steps I took to upgrade my XDA II. I believe it is now possible, using those procedures, to upgrade/downgrade the XDA II to/from ANY version/language/operator, as long as you don't have bootloader v1.06 installed.