PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Running SH4 Enigma2 on a Fortis HS8200 with loader 6.00



Audioniek
11.04.2014, 17:04
A remark up front: My native language is Dutch. I start this thread in English because my written English is far better than my written German. However I can read German pretty well, so if you want to respond in German, feel free to do so. I will answer back in English.

The Fortis HS8200 is the generic name for a receiver sold under various names. You may know it as:


Octagon SF1028P Noblence
Atevio AV7500/Atemio AM7600
Rebox RE-8500
Icecrypt STC6000
Opticum Actus Duo

and there are many more.
It was the first Fortis receiver with pluggable tuners.

The Fortis HS8200 has 64 Mbyte of flash memory, which unfortunately cannot be used to the full extend, due to limitations imposed by the boot loader 5.04 used to run Enigma2. Fortis has upgraded the loader to version 6.00 in the past for this receiver, but Enigma2 has not (as far as I know) been adapted to run with this loader.

The reason for this is probably that loader 6.00 has some new quirks and features but also new problems and that Fortis usually does not release much information about their loaders. Some people in the internet even have claimed loader 6.00 being a total mystery. I thought it cannot be that bad, and started out uncovering its secrets (more on that in a subsequent post).

In my view, loader 6.00 offers more advantages than disadvantages than version 5.04. The differences are as follows:


The boot loader now occupies only 384k of flash memory (was 1 Mbyte, gain: 640 kbyte);
Fortis has abandoned their scheme of creating a backup of the Application partition in flash. This means that compared to loader 5.04 7 Mbyte more flash memory becomes available;
The memory area 0x21C0000-0x21FFFFF, sometimes referred to as partition ConfigurationC, could not be flashed. With loader 6.00 it can (gain: 256 kbyte);
The three most important of the ten partitions (Root, Application and Device) are no longer flashed at fixed addresses but are dynamically allocated during the flash process. The kernel is still flashed at a fixed address, but the Root is flashed immediately following it. This means that between the partitions the holes of unused memory are limited to a part of an erase block (128 kbyte), but never more. Therefore flash memory can now be used more efficiently.

The net result: with loader 6.00 there is almost 8 Mbyte more flash memory available for the user compared to loader 5.04. With meticulous allocation, a contiguous block 60 Mbyte of flash memory can be made available for Enigma2.

Let's get practical first. Attached is a zip-file intended to be used with an Enigma2 build environment pulled from the max-git. Unpack the zip-file in a temporary location of choice. You will find a tdt directory and various subdirectories below it, matching the folders in the build environment. Now move/copy the files from the zip-file to the corresponding folders in the build environment. Most of them are additions.

These files are overwritten, so maybe you want to create a backup:


X/tdt/flash/common/fup.src./fup.c
X/tdt/cvs/cdk/root/release/halt_fortis_hdbox

If an executable file fup is present in X/tdt/flash/at7500, delete it. The file will be recompiled (new version) and put back when the .ird flash file is created.

The files /tdt/cvs/cdk/Patches/linux-sh4-atevio7500_600_mtdconcat_stm24_02XX.patch and /tdt/cvs/cdk/Patches/linux-sh4-atevio7500_600_setup_stm24_02XX.patch need some attention.
For an initial test, rename them to linux-sh4-atevio7500_mtdconcat_stm24_02XX.patch and linux-sh4-atevio7500_setup_stm24_02XX.patch (this will overwrite existing files). If you want to be able to select the loader version at build time, see an upcoming planned post about changing the build environment and rename them back when changing the build environment.

Building the image and creating the .ird flash file
Before starting the build, check that the kernel configuration file(s) to be used (in the folderX/tdt/cvs/cdk/Patches) contain these lines:

CONFIG_MTD_CONCAT=y
CONFIG_MTD_PARTITIONS=y
If they are absent, or the lines:

# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_PARTITIONS is not set
are present, add/replace them to/in the configuration file.
Please note that the configuration files on the max-git are correct in this respect.

If you have built an image for the atevio7500 in this environment before, you can just rebuild the kernel, otherwise a full build from scratch is recommended. Build the image in the normal way you are used to; the only changes are in the kernel because of changed flash layout.

After the build is complete, create the .ird flash file using the new fup. Go to the folder X/tdt/flash/at7500 and execute:

sudo ./at7500_L600.sh
The .ird file created will have the default reseller ID of 230200A0 (Octagon SF1208P with loader 6.00).
You can choose another reseller ID for your .ird file by adding it to the command like so (e.g. for a Rebox RE-8500):

sudo ./at7500_L600.sh 230100A0

This will create an .ird file in the folder X/tdt/flash/at7500/out.

That's it for now (more to follow).

Regards,



Audioniek.

Here is the zip you need: 7005

Update (14/04/2014): the max-git has been updated by santa with the files in this zip; bonkel has added an improvement. If you already have a build environment, just perform a git pull.

- - - Aktualisiert - - -

Loader upgrade and first run

If the receiver is running Enigma2 already, it has been downgraded to loader 5.04. To install loader 6.00, use the file attached. The reseller ID in the file has been set to 23020000. If you have downgraded the loader as per the instructions on this board, that should be the reseller ID in the receiver. Otherwise, use a reseller changer (or the new fup) and change only the second byte of the code (that is reseller byte).

The loader can be flashed in the normal way with channel up or volume up:


Unpack the zip-file to get the .ird file;
Place the file on a FAT32 formatted USB stick, the file must be the only file on the stick;
Power off the receiver using the mains switch at the back;
Put the USB stick in the receiver (either port will do);
Press and hold the key channel up (on Octagon SF1028P and Icecrypt STC6000 use volume up) on the front panel;
While holding the channel up or volume up key pressed, switch on the receiver with the mains switch;
Keep the key depressed until the display shows SCAN USB. Now release the key;
Flashing the loader is done in a jiffy, the display will show a blinking “Complete” when it is done.

Your receiver now has loader 6.00 with the reseller ID 230200A0 (=Octagon SF1028P with loader 6.00). If you start it up now, it will show Err 0x70 because the existing kernel in flash is in the wrong place.

Switch the receiver off and remove the USB stick. Replace the loader .ird file on the stick by the .ird file created in the first post. Then repeat the above channel up procedure. Flashing will take several minutes this time, as the full flash memory is rewritten, except the bootloader.

When flashing is complete, power off, remove the USB stick and power back on. Your image should now start. Please note that the first run will take some extra minutes because the kernel will scan the whole flash for locked and empty erase blocks. Several minutes may elapse before the spinner appears. Do not panic and be patient: this is normal. Subsequent starts will be faster. As an option you may want to watch the log on the serial port; there is more to see there.

Happy testing!

Regards,


Audioniek.

Loader 6.00 with Octagon reseller ID 230200A0: 7006

- - - Aktualisiert - - -

The new fup
To create a Fortis .ird flash update file Schishu has written the utility fup (flash utility program?) and has taken it to version 1.7. What he could not foresee, is that Fortis would start using all 4 reseller ID bytes in the header of .ird files; fup 1.7 can only change the first two of the four.

With loader 6.00 Fortis for the first time had the problem of having the same receiver in hardware but with an incompatible memory management compared to the same receiver with loader 5.04. They choose to use the fourth of the reseller ID bytes to distinguish the two and set it to hex 0xA0 (loader 5.04 has it at 00).

To create .ird files with non zero third and fourth reseller bytes fup needed to be expanded. I took the opportunity to enhance it a bit further and iron out some less comfortable aspects of the program.

The result is fup 1.8. The following was changed/added:


While creating Enigma2 flash files for Fortis receivers you need a tiny dummy partition file to fool the loader. This file is usually kept at the git and downloaded, then copied were it is needed. Fup now tests at the start if the file is present in the current directory. If it is not, fup will create it on the spot;
The -r option used to change the reseller ID of an .ird file has been expanded. It now accepts either a four character ID as argument (the old syntax) or an eight character one. Thus fup is command line compatible with the previous versions, and can now also set all four reseller ID bytes;
The default reseller ID in .ird created by the options -c and -ce is now set to 230200A0 (Octagon SF1028P Noblence with loader 6.00). If your want another reseller ID in the .ird file, use -r after creating it, or recompile fup after changing it in the source code;
The -ce option (create an enigma2 .ird file) had (in my view) very confusing lettered suboptions. They now have been given numbered equivalents as well as the -c option already had;
Previous versions of fup blindly open files without checking the result of that action. This resulted in segmentation faults and other nasties when a read-only file was opened for writing or a non-existing file was opened for reading. Fup now checks the file status and aborts neatly with a nice error message in those cases;
A new option has been added: -n. This can change/set the software version number in the header of an .ird file in a similar way -r sets/changes the reseller ID;
Option -c uses the rather clumsy (and undocumented) suboption -feelinglucky to add a boot loader partition to the .ird file being created. Fup now also accepts -00 and -ll as suboptions. The double characters are on purpose, because flashing the wrong boot loader can brick the receiver (hence -feelinglucky);
Fup can now operate silently on some suboptions. This may come in handy when you run it from a script that provides for a neat screen output. The silent operation is now default on options -c, -ce, -r, -s, -n and -x. To see the old screen output, use the new suboption -v with -c or -ce, or replace options -r, -s, -n and -x with -rv, -sv, -nv and -xv;
Some small errors were corrected.


The flash script files from the first post assume the new fup is used; otherwise you end up with .ird files having the wrong reseller ID for loader 6.00 (fourth byte is zero instead on 0xA0).

I already have an idea what to add in version 1.9...

Regards,


Audioniek.

The new fup source code is part of the zip file attachment in the first post and is available on the max-git as well.

- - - Aktualisiert - - -

Fup for windows
Some time ago (when I had not a single clue about Linux) I created a fup that can run on windows (in a CMD box). You can find it in the zip file attached. Fup.exe needs the zlib-dll in the same folder.

Features are about the same as fup 1.8, except it lacks silent operation. Version numbering for the windows version is different than for the Linux version. In true windows style the switch character has been changed from – to / and the options can be supplied in either upper or lower case.

Regards,


Audioniek.

Here is fup for windows: 7007

- - - Aktualisiert - - -

Some background information

To understand a planned upcoming post in which I will explain the how and why of the solution provided here for Enigma2 in flash on a Fortis HS8200 with loader 6.00, as well as the loaders secrets, you may want some basic knowledge of the internal workings of the boot loader and the startup process on Fortis receivers. This is explained in the two documents attached.

Do not be misled by the titles; the main subject of the document is indeed the IRD format description, but this is closely related to what the boot loader does at startup and that gets due attention as well.

I downloaded the German document from a now defunct forum about Octagon receivers and present it here unchanged. I thank author smogm for writing this very useful document about the subject; I learned a lot (and it enabled me to understand the fup source code).

The English version is a translation of the German original with a few errors corrected and some extra remarks and comments.

More to come in a few days time...

Regards,



Audioniek.

German original: 7008
English translation: 7009

Audioniek
14.04.2014, 22:36
The intricacies of the HS8200 loaders

Attached is a PDF containing 16 pages describing the details about the loaders used with the Forts HS8200 receiver. I have put it in a PDF file because of the size and complexity of the text.

More to come in a few days...

Regards,

Audioniek.

The PDF file: 7163

Audioniek
22.04.2014, 13:16
Update fup

Fup 1.8.1 is now available in the max-git. I fixed two compiler warnings and the dummy squashfs partition file is now padded with 0xFF (the empty state of flash memory) in stead of 0x00.

Regards,

Audioniek.

Audioniek
24.04.2014, 21:34
The loader 6.00 solution for the HS8200
As promised, here is a PDF document which explains why's and hows of the solution I arrived at for running SH4 Enigma2 on a Fortis HS8200.


Regards,


Audioniek.


The PDF: 7162

- - - Aktualisiert - - -

Selecting the loader version at build time
The current max-git can be used to build for either loader 5.04 or loader 6.00. This can be done by choosing the kernel patch level. Level 209 and 211 of the current max-git still build for loader 5.04; patch level 214 builds for loader 6.00.

If you want to be able to select the loader version at build time, install the patch files from the first post, and do not rename them (leave the _L600 in there). Then apply the diff-file in the attachment.

The diff has to be applied by hand. Since I have made it, the files involved have changed, and will continue to change. Those familiar with the diff-format will know what to do.

Regards,


Audioniek.

The zipped diff file: 7164

- - - Aktualisiert - - -

Back to Fortis stock firmware
This should be obvious: just flash a Fortis firmware suitable for the receiver which' version number starts with V2 using the channel up method described in the first post.

One remark tough. Because the ConfigurationC partition was used by the Enigma2 software, the Fortis firmware no longer sees it as valid. Upon the first start the firmware will reconstruct the partition automatically, but this can take quite some time with the display steady at RUN..

Be patient, it will start up eventually and function properly when it is finally done. Subsequent starts will be normal.

Regards,


Audioniek.

- - - Aktualisiert - - -

A final word
This little project has been a challenge to work on, and I am happy that the HDMU Images can use the fruits from it. I already have begun on the next project: running SH4 E2 in flash on a Fortis box with loader 7.XX. The testreceivers will be a Rebox RE-2210 (HS7119) and a Rebox RE-4210 (HS7819). And after that? E2 with loader 8.XX on a Fortis DS 260S (Rebox RE-4220 in NL) or ESS 300 (Rebox RE-8220 in NL) maybe? Yes... still more to come.

Regards,

Audioniek.

harryhase
24.04.2014, 22:09
great work; E2 on 7119 is very interisting; also the new cardiff modells ....

spartak73
25.04.2014, 00:18
And after that? E2 with loader 8.XX on a Fortis DS 260S (Rebox RE-4220 in NL) or ESS 300 (Rebox RE-8220 in NL) maybe? Yes... still more to come.



Ja das ist aber sehr Interessant. Ich habe bereits eine Modell mit Loader 8.15. Wenn was zum testen gibts, bin ich bereit. ;) Und bald bekomme ich auch die Twin Tuner Modell mit Loader 8.37. Also ich warte schon auf passende Image.

rdn
01.05.2014, 09:44
i need fup 1.8 for linux please

Audioniek
01.05.2014, 14:29
@rdn: As explained in the fourth post, either download the attachment in the first post, or get it from the max-git.

Regards,

Audioniek.

linch
07.12.2014, 13:24
@audionek
many thanks for your explanation but I have some confused ideas.
at the moment i have my octagon 1028 with loader 504 and pkt installed and i would build a neutrino image with loader 6.00 from max-git
As i read in your first post the max-git is update for build from kernel 214 a loader 6 image no need update with your build_env file and if i understand correctly
so no need change MTD_CONCAT into the config patch file only build the new 214 firmware and at the end i have loader 6 ready to flash.
In your second post i read that we need select at build time the loader applying the configure patch and only put the patch file from first post.
I would know at the end of build i need so your at7500_L600.sh with other your first post files and directory or at the end of build and after i apply the patch can build the ird file with max-git flash at7500 flash script because i see that with max-git flash-script i have an ird with 23030000.
Sorry for my bad english i hope you have understand my situation.
Thanks and regards.

ciccio81
07.12.2014, 14:05
die ird ist für den loader 5.04

l ird e per loder 5.04 per loader 6.0 l ird deve essere 23200A0

linch
07.12.2014, 14:55
die ird ist für den loader 5.04

l ird e per loder 5.04 per loader 6.0 l ird deve essere 23200A0

Thanks for answer, my problem is not the reseller id i know that for octagon 1028 with loader 6 is 23200A0, at the moment i'm only a bit confused on how build a loader 6 firmware from the git because i see that default build for kernel 214-215 is for loader 504.

Audioniek
07.12.2014, 16:57
Hello linch,

If you build from max-ddt or max-tdt you indeed need a lot of patching and adapting as pointed out in the first posts of this thread. I think for a HS8200 with loader 6.00 you are better off with this git (https://github.com/Audioniek/StartHere) where everything is for loader 6.00, including the Neutrino builds and the totally rewritten flash scripts. Hope you like it.

Regards,


Audioniek.

linch
07.12.2014, 17:01
Hello linch,

If you build from max-ddt or max-tdt you indeed need a lot of patching and adapting as pointed out in the first posts of this thread. I think for a HS8200 with loader 6.00 you are better off with this git (https://github.com/Audioniek/StartHere) where everything is for loader 6.00, including the Neutrino builds and the totally rewritten flash scripts. Hope you like it.

Regards,


Audioniek.

Hi to you audionek and many thanks for your work now i go to see your git and try to build from it.
Best regards.