Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Does anyone understand AML-AUTOSCRIPT?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Does anyone understand AML-AUTOSCRIPT?

    Hi Guys

    Really hoping someone technically minded can help me out please?

    I appear to have the MX2 box from hell and despite trying every combination of Roms and every recovery method - my box can not be successfully flashed other than with a manufacturer supplied Rom image (Which is a rubbish 1.1.4 version full of bugs). I have managed to get Matricom 1.1.5 but it had issues with data partition. The pre 1.1.5 patch is impossible as the upgrade app isn't in my version of Android. I can flash Linux using OTA method but it only boots once directly following the flash then hangs on the first boot screen on subsequent attempts. The box will never enter the Android recovery manu unless a pre-prepared SD card with a boot.bin hidden in an extra partition exists.

    I seem to have 10 MTD partitions which looks odd as most others have 9 from what I can see. Any ideas if one of these partitions is causing the behaviour I am experiencing?

    dev: size erasesize name
    MTD0: 00800000 00200000 “logo”
    MTD1: 00800000 00200000 “aml_logo”
    MTD2: 00800000 00200000 “recovery”
    MTD3: 00800000 00200000 “boot”
    MTD4: 40000000 00200000 “system”
    MTD5: 20000000 00200000 “cache”
    MTD6: 10000000 00200000 “backup”
    MTD7: 18c800000 00200000 “data”
    MTD8: 00060000 00001000 “bootloader”
    MTD9: 00008000 00001000 “ubootenv”.

    Further to this, this is the aml_autoscript that has to be on the SD card to flash the device with the toothpick method.

    'VÇ_DSà)`°9˛/amlogic auto scriptXif mmcinfo
    then
    if fatexist mmc 0:1 u-boot.bin
    then fatload mmc 0:1 82000000 u-boot.bin
    echo @@@@@@@@@@@@@@@@@@@@@@@@ erase spiflash : need about one minute @@@@@@@@@@@@@@@@@@@@@@
    sf probe 2
    sf erase 0 600000
    sf write 82000000 0 60000
    echo @@@@@@@@@@@@@@@@@@@@@@@@ erase nandflash @@@@@@@@@@@@@@@@@@@@@@
    nand erase 0
    reset
    fi
    fi

    This script points the device to look for the uboot.bin in the special partition created by the SD card maker tool provided by the manufacturer. This is the only way to factory reset this device - nothing else works - I have tried everything.

    Would anyone be clued up enough to suggest any amendments to this script to allow me more freedom in flashing rome.

    Ultimately, I would like to flash the latest Matricom images with OTA updates or a Linux build with 13.1 gotham but as things stand this appears impossible.

    Any help would be greatly appreciated!

    Thanks
    Chris

    #2
    Why do you open a new thread instead of continue there


    Do you ever make a picture of the PCB?
    RK3288 Devices
    - Overview BOX (LINK !)
    - Overview STICK (Dongle) (LINK !)

    MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
    UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
    Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
    Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

    RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
    Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

    Comment


      #3
      I think this thread would be a good reference point about the aml_autoscript discussion...

      Sent from my TF300T using Tapatalk

      Comment


        #4
        Hi no_spam

        I'm asking a different question here having tried every type of flash available on the other thread. I'm now thinking the only way to get round the restrictions seemingly imposed on this box would be to amend the recovery sequence somehow to free it from it's insistence on the manufacturers files.

        I'll take the box apart shortly to have a look at the pcb.

        Kozmo - thanks for the MTD layout. Looks like yours had 9 partitions and now 10.

        Obviously yours is totally different to mine and I need to find out the reasons for the variances! Research time!

        Thanks
        Chris

        Comment


          #5
          Originally posted by dairug View Post
          ...
          This script points the device to look for the uboot.bin in the special partition created by the SD card maker tool provided by the manufacturer. ...
          I don't think so, because the MIDNIGHT-RECOVERY-SD-CARD and the package offer by BenniBenassi doesn't use this script but also use the uboot at the beginning of the SD-Card (it isn't a special partition)

          the same at s802


          BUT the CMW by daemonium via sd-card use it (but not the uboot at the beginning of the SD-Card)...
          Last edited by no_spam_for_me; 07-24-2014, 10:17. Reason: add link and developer name
          RK3288 Devices
          - Overview BOX (LINK !)
          - Overview STICK (Dongle) (LINK !)

          MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
          UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
          Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
          Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

          RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
          Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

          Comment


            #6
            Hi

            I've tried Bennibenassi's method and it won't work. Luis on the other thread is having the same issue with this box as well.

            Perhaps the way the MTD partitions are set up the box looks for this special partition which is the manufacturers way of locking you to their own crumby firmware.

            They insist on you using a windows executable file which you point to their uboot.bin file which it embeds in a partition on the SD card. The other recovery files such as aml_autoscript and factory_update are put on the main visible partition on the SD card to flash the device using the toothpick.

            I'm not aware of any other boxes which insist on a pre prepared SD card to be in the slot when the toothpick method is used. This box will not enter recovery mode without the SD card.

            Do you think it's to do with the MTD partitions in terms of the box not entering recovery mode with purely the toothpick depressed?

            It would be interesting to learn which part of the nand would control the behaviour on startup.

            I'm getting a sense that this box needs a factory reset to completely rewrite the MTD partitions to behave nicely - would be interesting to learn if there is a way to do this at home by connecting it to a PC!

            Cheers
            Chris

            Comment


              #7
              As I wrote:
              Originally posted by no_spam_for_me View Post
              ...Do you ever make a picture of the PCB?...
              RK3288 Devices
              - Overview BOX (LINK !)
              - Overview STICK (Dongle) (LINK !)

              MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
              UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
              Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
              Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

              RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
              Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

              Comment


                #8
                Originally posted by dairug View Post
                ...
                I'm not aware of any other boxes which insist on a pre prepared SD card to be in the slot when the toothpick method is used. This box will not enter recovery mode without the SD card...
                Where can i download an image of this special SD card or the tool to generate this special SD card?
                RK3288 Devices
                - Overview BOX (LINK !)
                - Overview STICK (Dongle) (LINK !)

                MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
                UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
                Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
                Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

                RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
                Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

                Comment


                  #9
                  Explanation of aml_autoscript

                  Hi,

                  aml_autoscript is basically set of u-boot commands packed with U-Boot tool mkimage (available under Linux as part of u-boot-tools package)

                  sample of script that will load recovery.img from sdcard and boot it:
                  Code:
                  mmcinfo
                  fatload mmc 0 82000000 recovery.img
                  bootm
                  To convert that code to aml_autoscript, save it as txt file, lets say amltxtscript. After that, simple in terminal run command (inside folder where amltxtscript exists):
                  Code:
                  mkimage -A arm -O linux -T script -C none -d amltxtscript aml_autoscript
                  And thats your aml_autoscript.

                  About MX2: Be warned that bootloader on these boxes is not stored on SPI chip but on nand, so erasing nand will kill bootloader.
                  If you find my work useful, buy me a beer
                  Homepage: http://www.stane1983.com

                  Comment


                    #10
                    Originally posted by stane1983 View Post
                    Code:
                    mmcinfo
                    fatload mmc 0 82000000 recovery.img
                    bootm
                    That's what daemonium do with his cwm...

                    Originally posted by stane1983 View Post
                    About MX2: Be warned that bootloader on these boxes is not stored on SPI chip but on nand, so erasing nand will kill bootloader.
                    That's the fault that BenniBenassi had done...
                    And at that moment also the "special SD" doesn#t work any longer...
                    RK3288 Devices
                    - Overview BOX (LINK !)
                    - Overview STICK (Dongle) (LINK !)

                    MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
                    UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
                    Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
                    Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

                    RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
                    Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

                    Comment


                      #11
                      Originally posted by no_spam_for_me View Post
                      That's what daemonium do with his cwm...



                      That's the fault that BenniBenassi had done...
                      And at that moment also the "special SD" doesn#t work any longer...
                      Shorting nand pins 5 and 6 during power on for 2-3 seconds should trigger boot from 'special sdcard' or recovery sdcard.
                      If you find my work useful, buy me a beer
                      Homepage: http://www.stane1983.com

                      Comment


                        #12
                        Hi No-Spam

                        I'll take a box apart this evening and post a picture. I have a copy of the executable that creates the SD card, I can email it to you if you PM me your email address.

                        It's a simple program. It opens up a Windows quick format window, asks you to point it to the uboot.bin file enclosed with the recovery files then it embeds it in a separate partition on the card. I then have to manually copy the remaining files onto the card to sue the toothpick method to recover the device.

                        Looking at my auto script, i'm presuming that this command is the one referring to this SD card partition?

                        'VÇ_DSà)`°9˛/amlogic auto scriptXif mmcinfo
                        then
                        if fatexist mmc 0:1 u-boot.bin
                        Again, thanks for the support, much appreciated!

                        Hi Stane, thanks for the info.

                        Are you saying that regardless of my MTD layout, I should be able to edit the aml_autoscript to flash a new Rom to my MX2 without any issues?

                        In my other thread, Bob (Finless) mentioned that if I was having to boot from an SD card to recover then this meant there was no recovery option built in to the device. Would you know of any way of improving this so the box behaves normally? Ideally i'd like the box to give me the Android recovery menu with the toothpick inserted without the use of an SD card!

                        What I'm trying to achieve here is I'd like to get off the awful 1.1.4 generic firmware I'm forced to use at the moment either to a matricom rom which allows OTA updating or even a 13.1 gotham linux build.

                        Where I'm a little worried is I need to learn more about the old MTD and new MTD layouts. Maybe my safest upgrade path would be to:

                        1. Edit aml_autoscript to allow a flash of 1.1.4 MAtricom image.
                        2. Run pre 1.1.5 upgrade fix
                        3. Install Matricom 1.1.5 full (New MTD)

                        Which should give me the option of Ota updates or to flash a new MTD rom image?

                        Forgive me if I'm wrong here, really trying to piece this all together - it's all very new to me!

                        Thanks
                        Chris

                        Comment


                          #13
                          Originally posted by dairug View Post
                          Hi No-Spam

                          I'll take a box apart this evening and post a picture. I have a copy of the executable that creates the SD card, I can email it to you if you PM me your email address.

                          It's a simple program. It opens up a Windows quick format window, asks you to point it to the uboot.bin file enclosed with the recovery files then it embeds it in a separate partition on the card. I then have to manually copy the remaining files onto the card to sue the toothpick method to recover the device.
                          Sorry, but I have to correct you. Recovery sdcard for amlogic is not using any special partition. It basically puts bootloader to beginning of sdcard and resizes partition of sdcard not to overwrite bootloader. See here how to make recovery sdcard from Linux.

                          Originally posted by dairug View Post
                          Looking at my auto script, i'm presuming that this command is the one referring to this SD card partition?

                          'VÇ_DSà)`°9˛/amlogic auto scriptXif mmcinfo
                          then
                          if fatexist mmc 0:1 u-boot.bin
                          Again, thanks for the support, much appreciated!
                          Editing aml_autoscript by any kind of text editor will just corrupt it. You have to create new one. See my previous post

                          Originally posted by dairug View Post
                          Hi Stane, thanks for the info.

                          Are you saying that regardless of my MTD layout, I should be able to edit the aml_autoscript to flash a new Rom to my MX2 without any issues?

                          In my other thread, Bob (Finless) mentioned that if I was having to boot from an SD card to recover then this meant there was no recovery option built in to the device. Would you know of any way of improving this so the box behaves normally? Ideally i'd like the box to give me the Android recovery menu with the toothpick inserted without the use of an SD card!

                          What I'm trying to achieve here is I'd like to get off the awful 1.1.4 generic firmware I'm forced to use at the moment either to a matricom rom which allows OTA updating or even a 13.1 gotham linux build.

                          Where I'm a little worried is I need to learn more about the old MTD and new MTD layouts. Maybe my safest upgrade path would be to:

                          1. Edit aml_autoscript to allow a flash of 1.1.4 MAtricom image.
                          2. Run pre 1.1.5 upgrade fix
                          3. Install Matricom 1.1.5 full (New MTD)

                          Which should give me the option of Ota updates or to flash a new MTD rom image?

                          Forgive me if I'm wrong here, really trying to piece this all together - it's all very new to me!

                          Thanks
                          Chris
                          1. Create aml_autoscript which will (for mx2) look like this:
                          Code:
                          mmcinfo
                          fatload mmc 0 82000000 u-boot.bin
                          nand rom_protect off
                          nand scrub
                          nand rom_write 82000000 0 60000
                          nand rom_protect on
                          2. Put desired firmware on your sdcard and if u-boot.bin does not exist in extracted files (.zip file and recovery.img), open zip file, extract bootloader.img to sdcard and rename it to u-boot.bin
                          3. Try to recover your box with desired firmware (all firmware files must be from same firmware which means you can flash directly to Matricom 1.1.5 full)

                          Cheers
                          If you find my work useful, buy me a beer
                          Homepage: http://www.stane1983.com

                          Comment


                            #14
                            hi Stane

                            You can correct me as much as you like when your information is as helpful as this - thank you very much indeed.

                            I'll have a go now - no time like the present as they say.

                            Just to confirm, you've obviously looked at the MTD layout earlier in the post and there's nothing in there that concerns you within that?

                            The reason I'm being careful is because U have tried every single recovery option I can find including Benibenassi's method and nothing will flash this box other than the solution determined by the manufacturer.
                            Have you seen the SD card software that prepares the SD card that I have had to use. Shall I sent it to you for a quick look perhaps?

                            Thanks again - i'd be screwed without the help!

                            Chris

                            Comment


                              #15
                              Just to confirm - I have had this info as well which was also helpful.

                              This error
                              Assert failed:write_raw_image ("/tmp/bootloader.img", "boot loader).

                              Is because the edify script in the ZIP is not correct for the labels of your partitions! Edit that script. Remove and assertion checks at the beginning, and edit the write line to say bootloader not boot loader.

                              You cannot use a kernel with different MTD. So you will need a kernel that uses YOUR MTD. Learn to pack and unpack boot.img. You can take a known good kernel and put it in boot.img from the ROM your trying to use. Usually this works but not always.

                              Also if it wont boot into recovery then the recovery partition does not have recovery in it! Some ROM you flashed or something erased that and did not write a good recovery in there. If uboot is good, just putting a recovery.img on sdcard should work without having to make a special sdcard. special sdcard is only needed when uboot is hosed up.

                              Cheers
                              Chris

                              Comment

                              Working...
                              X