Forum switched to read-only as of 2020/06/01
Latest product reviews |
---|
![]() |
![]() |
Smartphones ![]() |
TV Connect ![]() |
![]() |
ClockworkMod (CWM) Recovery easy install for RK3066 and RK3188 -- TWRP/CWM Flash-Tool and root for RK3288
Please donate to support OMA and CrewRKTablets firmware work, thank you !


Firmware Guru
2011/11/19

Looking at the parameter file which is repeated 5 times in the start of the nand flash (using the V1.2 example) we seem to have a dos formatted file, is this correct (android is linux) as linux normally uses just 0A'a to terminate lines, not 0D 0A sequemce, anybody have the aource to the code which reads the parameters ?
# rkflashtool r 0x00 20 | hexdump -C
PARMDFIRMWARE_VER:0.2.3
MACHINE_MODEL:AN10G2
MACHINE_ID:007
MANUFACTURER:RK29SDK
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 2929
CHECK_MASK: 0x80
KERNEL_IMG: 0x60408000
CMDLINE: console=ttyS1,115200n8n androidboot.console=ttyS1 init=/init initrd=0x62000000,0x500000 mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x00004000@0x00004000(kernel),0x00002000@0x00008000(boot),0x00004000@0x0000A000(recovery),0x00080000@0x0000E000(system),0x00082000@0x0008E000(backup),0x0003a000@0x00110000(cache),0x00080000@0x0014a000(userdata),0x00002000@0x001ca000(kpanic),-@0x001cc000(user)
00000000 50 41 52 4d 5f 02 00 00 46 49 52 4d 57 41 52 45 |PARM_...FIRMWARE|
00000010 5f 56 45 52 3a 30 2e 32 2e 33 0d 0a 4d 41 43 48 |_VER:0.2.3..MACH|
00000020 49 4e 45 5f 4d 4f 44 45 4c 3a 41 4e 31 30 47 32 |INE_MODEL:AN10G2|
00000030 0d 0a 4d 41 43 48 49 4e 45 5f 49 44 3a 30 30 37 |..MACHINE_ID:007|
00000040 0d 0a 4d 41 4e 55 46 41 43 54 55 52 45 52 3a 52 |..MANUFACTURER:R|
00000050 4b 32 39 53 44 4b 0d 0a 4d 41 47 49 43 3a 20 30 |K29SDK..MAGIC: 0|
00000060 78 35 30 34 31 35 32 34 42 0d 0a 41 54 41 47 3a |x5041524B..ATAG:|
00000070 20 30 78 36 30 30 30 30 38 30 30 0d 0a 4d 41 43 | 0x60000800..MAC|
00000080 48 49 4e 45 3a 20 32 39 32 39 0d 0a 43 48 45 43 |HINE: 2929..CHEC|
00000090 4b 5f 4d 41 53 4b 3a 20 30 78 38 30 0d 0a 4b 45 |K_MASK: 0x80..KE|
000000a0 52 4e 45 4c 5f 49 4d 47 3a 20 30 78 36 30 34 30 |RNEL_IMG: 0x6040|
000000b0 38 30 30 30 0d 0a 23 43 4f 4d 42 49 4e 41 54 49 |8000..#COMBINATI|
000000c0 4f 4e 5f 4b 45 59 3a 20 30 2c 36 2c 41 2c 31 2c |ON_KEY: 0,6,A,1,|
000000d0 30 0d 0a 43 4d 44 4c 49 4e 45 3a 20 63 6f 6e 73 |0..CMDLINE: cons|
000000e0 6f 6c 65 3d 74 74 79 53 31 2c 31 31 35 32 30 30 |ole=ttyS1,115200|
000000f0 6e 38 6e 20 61 6e 64 72 6f 69 64 62 6f 6f 74 2e |n8n androidboot.|
00000100 63 6f 6e 73 6f 6c 65 3d 74 74 79 53 31 20 69 6e |console=ttyS1 in|
00000110 69 74 3d 2f 69 6e 69 74 20 69 6e 69 74 72 64 3d |it=/init initrd=|
00000120 30 78 36 32 30 30 30 30 30 30 2c 30 78 35 30 30 |0x62000000,0x500|
00000130 30 30 30 20 6d 74 64 70 61 72 74 73 3d 72 6b 32 |000 mtdparts=rk2|
00000140 39 78 78 6e 61 6e 64 3a 30 78 30 30 30 30 32 30 |9xxnand:0x000020|
00000150 30 30 40 30 78 30 30 30 30 32 30 30 30 28 6d 69 |00@0x00002000(mi|
00000160 73 63 29 2c 30 78 30 30 30 30 34 30 30 30 40 30 |sc),0x00004000@0|
00000170 78 30 30 30 30 34 30 30 30 28 6b 65 72 6e 65 6c |x00004000(kernel|
00000180 29 2c 30 78 30 30 30 30 32 30 30 30 40 30 78 30 |),0x00002000@0x0|
00000190 30 30 30 38 30 30 30 28 62 6f 6f 74 29 2c 30 78 |0008000(boot),0x|
000001a0 30 30 30 30 34 30 30 30 40 30 78 30 30 30 30 41 |00004000@0x0000A|
000001b0 30 30 30 28 72 65 63 6f 76 65 72 79 29 2c 30 78 |000(recovery),0x|
000001c0 30 30 30 38 32 30 30 30 40 30 78 30 30 30 30 45 |00082000@0x0000E|
000001d0 30 30 30 28 62 61 63 6b 75 70 29 2c 30 78 30 30 |000(backup),0x00|
000001e0 30 33 61 30 30 30 40 30 78 30 30 30 39 30 30 30 |03a000@0x0009000|
000001f0 30 28 63 61 63 68 65 29 2c 30 78 30 30 31 30 30 |0(cache),0x00100|
00000200 30 30 30 40 30 78 30 30 30 63 61 30 30 30 28 75 |000@0x000ca000(u|
00000210 73 65 72 64 61 74 61 29 2c 30 78 30 30 30 30 32 |serdata),0x00002|
00000220 30 30 30 40 30 78 30 30 31 63 61 30 30 30 28 6b |000@0x001ca000(k|
00000230 70 61 6e 69 63 29 2c 30 78 30 30 30 38 30 30 30 |panic),0x0008000|
00000240 30 40 30 78 30 30 31 63 63 30 30 30 28 73 79 73 |0@0x001cc000(sys|
00000250 74 65 6d 29 2c 2d 40 30 78 30 30 32 34 63 30 30 |tem),-@0x0024c00|
00000260 30 28 75 73 65 72 29 e0 9f f6 c6 00 00 00 00 00 |0(user).........|
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|


Contributor
2011/12/10

That is a raw dump. The parameter file is in the ROM as a seperate file and defines the size and offset of the ROM file for each .img or partition. It is a OD/OA file so I guess you could say it is DOS. In my development post I explain how it is setup and what it does. For some reason though I cannot find my original post where I explained it to someone 🙁 The reorganization must have left the post somehwhere other than development. In order to make my ROM I had to learn what it was doing and how. If you pull the parameter file out of my ROM and look at it, it will probably make more sense than that ram dump.
Bottom line each .img or partition setup is proceded by it size and then offset into the ROM file. For instance 0x00002000@0000000(boot), 0x00080000@00002000(kernel), 0x0004000@00082000(cache)
The number is the size@offset. So first img starts at 0 and is 2000 is size. The the next one after it starts at offset 2000 and is 80000 in size. So on and so forth.
Bob


Firmware Guru
2011/11/19

finless said
That is a raw dump. The parameter file is in the ROM as a seperate file and defines the size and offset of the ROM file for each .img or partition. It is a OD/OA file so I guess you could say it is DOS. In my development post I explain how it is setup and what it does. For some reason though I cannot find my original post where I explained it to someone 🙁 The reorganization must have left the post somehwhere other than development. In order to make my ROM I had to learn what it was doing and how. If you pull the parameter file out of my ROM and look at it, it will probably make more sense than that ram dump.
Bob,
I'm using Linux (64bit) so I'm having to build my own tools as I understand what needs to be done. Linux is the ideal Android/Linux development environment.
This is the parameter file from your image that is written to flash after updating to v1.2. The rkflashtool is running on my pc and reading the first 20 hex (32) blocks (16384 bytes) directly from the tablets flash at address 0x0.
rkflashtool can read/write the flash over usb from the pc when the tablet is in recovery mode.
When I get the time I'll remove the carage returns (0D's), write a script to recompute the parameter file size, partition offsets & parameter crc and rewrite 5 times to the flash at block offsets 0x0, 0x20, 0x40, 0x60, 0x80.
Steve


Firmware Guru
2011/11/19

I suspect somewhere along the line using Windowz & DOS has resulted in the parameter file being corrupted . . . I removed the carage returns and rebuilt the parameter file and re-programmed the flash and all worked well.
Well I bit the bullet and stripped the carage returms, recalculated the parameter length and crc and wrote the resulting parameter file to the tablets flas and it's booting...
Here'e the writes followed by a read of the flash and executed a reboot:[stevep@localhost v1.2]$ rkflashtool w 0x00 20 < p00rc
rkflashtool: info: interface claimed
rkflashtool: info: writing flash memory at offset 0x00000000
[stevep@localhost v1.2]$ rkflashtool w 0x20 20 < p00rc
rkflashtool: info: interface claimed
rkflashtool: info: writing flash memory at offset 0x00000020
[stevep@localhost v1.2]$ rkflashtool w 0x40 20 < p00rc
rkflashtool: info: interface claimed
rkflashtool: info: writing flash memory at offset 0x00000040
[stevep@localhost v1.2]$ rkflashtool w 0x60 20 < p00rc
rkflashtool: info: interface claimed
rkflashtool: info: writing flash memory at offset 0x00000060
[stevep@localhost v1.2]$ rkflashtool w 0x80 20 < p00rc
rkflashtool: info: interface claimed
rkflashtool: info: writing flash memory at offset 0x00000080
[stevep@localhost v1.2]$ rkflashtool r 0x00 20 | hexdump -C
rkflashtool: info: interface claimed
rkflashtool: info: reading flash memory at offset 0x00000000
00000000 50 41 52 4d 56 02 00 00 46 49 52 4d 57 41 52 45 |PARMV...FIRMWARE|
00000010 5f 56 45 52 3a 30 2e 32 2e 33 0a 4d 41 43 48 49 |_VER:0.2.3.MACHI|
00000020 4e 45 5f 4d 4f 44 45 4c 3a 41 4e 31 30 47 32 0a |NE_MODEL:AN10G2.|
00000030 4d 41 43 48 49 4e 45 5f 49 44 3a 30 30 37 0a 4d |MACHINE_ID:007.M|
00000040 41 4e 55 46 41 43 54 55 52 45 52 3a 52 4b 32 39 |ANUFACTURER:RK29|
00000050 53 44 4b 0a 4d 41 47 49 43 3a 20 30 78 35 30 34 |SDK.MAGIC: 0x504|
00000060 31 35 32 34 42 0a 41 54 41 47 3a 20 30 78 36 30 |1524B.ATAG: 0x60|
00000070 30 30 30 38 30 30 0a 4d 41 43 48 49 4e 45 3a 20 |000800.MACHINE: |
00000080 32 39 32 39 0a 43 48 45 43 4b 5f 4d 41 53 4b 3a |2929.CHECK_MASK:|
00000090 20 30 78 38 30 0a 4b 45 52 4e 45 4c 5f 49 4d 47 | 0x80.KERNEL_IMG|
000000a0 3a 20 30 78 36 30 34 30 38 30 30 30 0a 23 43 4f |: 0x60408000.#CO|
000000b0 4d 42 49 4e 41 54 49 4f 4e 5f 4b 45 59 3a 20 30 |MBINATION_KEY: 0|
000000c0 2c 36 2c 41 2c 31 2c 30 0a 43 4d 44 4c 49 4e 45 |,6,A,1,0.CMDLINE|
000000d0 3a 20 63 6f 6e 73 6f 6c 65 3d 74 74 79 53 31 2c |: console=ttyS1,|
000000e0 31 31 35 32 30 30 6e 38 6e 20 61 6e 64 72 6f 69 |115200n8n androi|
000000f0 64 62 6f 6f 74 2e 63 6f 6e 73 6f 6c 65 3d 74 74 |dboot.console=tt|
00000100 79 53 31 20 69 6e 69 74 3d 2f 69 6e 69 74 20 69 |yS1 init=/init i|
00000110 6e 69 74 72 64 3d 30 78 36 32 30 30 30 30 30 30 |nitrd=0x62000000|
00000120 2c 30 78 35 30 30 30 30 30 20 6d 74 64 70 61 72 |,0x500000 mtdpar|
00000130 74 73 3d 72 6b 32 39 78 78 6e 61 6e 64 3a 30 78 |ts=rk29xxnand:0x|
00000140 30 30 30 30 32 30 30 30 40 30 78 30 30 30 30 32 |00002000@0x00002|
00000150 30 30 30 28 6d 69 73 63 29 2c 30 78 30 30 30 30 |000(misc),0x0000|
00000160 34 30 30 30 40 30 78 30 30 30 30 34 30 30 30 28 |4000@0x00004000(|
00000170 6b 65 72 6e 65 6c 29 2c 30 78 30 30 30 30 32 30 |kernel),0x000020|
00000180 30 30 40 30 78 30 30 30 30 38 30 30 30 28 62 6f |00@0x00008000(bo|
00000190 6f 74 29 2c 30 78 30 30 30 30 34 30 30 30 40 30 |ot),0x00004000@0|
000001a0 78 30 30 30 30 41 30 30 30 28 72 65 63 6f 76 65 |x0000A000(recove|
000001b0 72 79 29 2c 30 78 30 30 30 38 32 30 30 30 40 30 |ry),0x00082000@0|
000001c0 78 30 30 30 30 45 30 30 30 28 62 61 63 6b 75 70 |x0000E000(backup|
000001d0 29 2c 30 78 30 30 30 33 61 30 30 30 40 30 78 30 |),0x0003a000@0x0|
000001e0 30 30 39 30 30 30 30 28 63 61 63 68 65 29 2c 30 |0090000(cache),0|
000001f0 78 30 30 31 30 30 30 30 30 40 30 78 30 30 30 63 |x00100000@0x000c|
00000200 61 30 30 30 28 75 73 65 72 64 61 74 61 29 2c 30 |a000(userdata),0|
00000210 78 30 30 30 30 32 30 30 30 40 30 78 30 30 31 63 |x00002000@0x001c|
00000220 61 30 30 30 28 6b 70 61 6e 69 63 29 2c 30 78 30 |a000(kpanic),0x0|
00000230 30 30 38 30 30 30 30 40 30 78 30 30 31 63 63 30 |0080000@0x001cc0|
00000240 30 30 28 73 79 73 74 65 6d 29 2c 2d 40 30 78 30 |00(system),-@0x0|
00000250 30 32 34 63 30 30 30 28 75 73 65 72 29 0a df de |024c000(user)...|
00000260 25 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |%C..............|
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00004000
[stevep@localhost v1.2]$
[stevep@localhost v1.2]$ rkflashtool b
rkflashtool: info: interface claimed
rkflashtool: info: rebooting device...
[stevep@localhost v1.2]$
It's rebooted fine 🙂


Contributor
2011/12/10

The parameter file in my ROM was edit in linux. In fact I learned my lesson early on not to even copy files that go into a ROM with a PC. It "touches" the files and changes them and this can make the flash not boot. Amazing...
So how did the param file get corrupted in yours?
Not sure I am understanding.
Bob


Firmware Guru
2011/11/19

finless said
The parameter file in my ROM was edit in linux. In fact I learned my lesson early on not to even copy files that go into a ROM with a PC. It "touches" the files and changes them and this can make the flash not boot. Amazing...
So how did the param file get corrupted in yours?
Not sure I am understanding.
Bob
Bob,
I'm not saying you did it, it was probably done before you started modifying it. If I corrupted it the crc would of been broken and it would fail to load !
I've just taken the parameter file from your v1.2 image and sumped it with a hex dumper:
[stevep@localhost v1.2]$ hexdump -C parameter-finless
00000000 46 49 52 4d 57 41 52 45 5f 56 45 52 3a 30 2e 32 |FIRMWARE_VER:0.2|
00000010 2e 33 0d 0a 4d 41 43 48 49 4e 45 5f 4d 4f 44 45 |.3..MACHINE_MODE|
00000020 4c 3a 41 4e 31 30 47 32 0d 0a 4d 41 43 48 49 4e |L:AN10G2..MACHIN|
00000030 45 5f 49 44 3a 30 30 37 0d 0a 4d 41 4e 55 46 41 |E_ID:007..MANUFA|
00000040 43 54 55 52 45 52 3a 52 4b 32 39 53 44 4b 0d 0a |CTURER:RK29SDK..|
00000050 4d 41 47 49 43 3a 20 30 78 35 30 34 31 35 32 34 |MAGIC: 0x5041524|
00000060 42 0d 0a 41 54 41 47 3a 20 30 78 36 30 30 30 30 |B..ATAG: 0x60000|
00000070 38 30 30 0d 0a 4d 41 43 48 49 4e 45 3a 20 32 39 |800..MACHINE: 29|
00000080 32 39 0d 0a 43 48 45 43 4b 5f 4d 41 53 4b 3a 20 |29..CHECK_MASK: |
00000090 30 78 38 30 0d 0a 4b 45 52 4e 45 4c 5f 49 4d 47 |0x80..KERNEL_IMG|
000000a0 3a 20 30 78 36 30 34 30 38 30 30 30 0d 0a 23 43 |: 0x60408000..#C|
000000b0 4f 4d 42 49 4e 41 54 49 4f 4e 5f 4b 45 59 3a 20 |OMBINATION_KEY: |
000000c0 30 2c 36 2c 41 2c 31 2c 30 0d 0a 43 4d 44 4c 49 |0,6,A,1,0..CMDLI|
000000d0 4e 45 3a 20 63 6f 6e 73 6f 6c 65 3d 74 74 79 53 |NE: console=ttyS|
000000e0 31 2c 31 31 35 32 30 30 6e 38 6e 20 61 6e 64 72 |1,115200n8n andr|
000000f0 6f 69 64 62 6f 6f 74 2e 63 6f 6e 73 6f 6c 65 3d |oidboot.console=|
00000100 74 74 79 53 31 20 69 6e 69 74 3d 2f 69 6e 69 74 |ttyS1 init=/init|
00000110 20 69 6e 69 74 72 64 3d 30 78 36 32 30 30 30 30 | initrd=0x620000|
00000120 30 30 2c 30 78 35 30 30 30 30 30 20 6d 74 64 70 |00,0x500000 mtdp|
00000130 61 72 74 73 3d 72 6b 32 39 78 78 6e 61 6e 64 3a |arts=rk29xxnand:|
00000140 30 78 30 30 30 30 32 30 30 30 40 30 78 30 30 30 |0x00002000@0x000|
00000150 30 32 30 30 30 28 6d 69 73 63 29 2c 30 78 30 30 |02000(misc),0x00|
00000160 30 30 34 30 30 30 40 30 78 30 30 30 30 34 30 30 |004000@0x0000400|
00000170 30 28 6b 65 72 6e 65 6c 29 2c 30 78 30 30 30 30 |0(kernel),0x0000|
00000180 32 30 30 30 40 30 78 30 30 30 30 38 30 30 30 28 |2000@0x00008000(|
00000190 62 6f 6f 74 29 2c 30 78 30 30 30 30 34 30 30 30 |boot),0x00004000|
000001a0 40 30 78 30 30 30 30 41 30 30 30 28 72 65 63 6f |@0x0000A000(reco|
000001b0 76 65 72 79 29 2c 30 78 30 30 30 38 32 30 30 30 |very),0x00082000|
000001c0 40 30 78 30 30 30 30 45 30 30 30 28 62 61 63 6b |@0x0000E000(back|
000001d0 75 70 29 2c 30 78 30 30 30 33 61 30 30 30 40 30 |up),0x0003a000@0|
000001e0 78 30 30 30 39 30 30 30 30 28 63 61 63 68 65 29 |x00090000(cache)|
000001f0 2c 30 78 30 30 31 30 30 30 30 30 40 30 78 30 30 |,0x00100000@0x00|
00000200 30 63 61 30 30 30 28 75 73 65 72 64 61 74 61 29 |0ca000(userdata)|
00000210 2c 30 78 30 30 30 30 32 30 30 30 40 30 78 30 30 |,0x00002000@0x00|
00000220 31 63 61 30 30 30 28 6b 70 61 6e 69 63 29 2c 30 |1ca000(kpanic),0|
00000230 78 30 30 30 38 30 30 30 30 40 30 78 30 30 31 63 |x00080000@0x001c|
00000240 63 30 30 30 28 73 79 73 74 65 6d 29 2c 2d 40 30 |c000(system),-@0|
00000250 78 30 30 32 34 63 30 30 30 28 75 73 65 72 29 0d |x0024c000(user).|
00000260 0a |.|
00000261
finless said
That is a raw dump. The parameter file is in the ROM as a seperate file and defines the size and offset of the ROM file for each .img or partition. It is a OD/OA file so I guess you could say it is DOS. In my development post I explain how it is setup and what it does. For some reason though I cannot find my original post where I explained it to someone 🙁 The reorganization must have left the post somehwhere other than development. In order to make my ROM I had to learn what it was doing and how. If you pull the parameter file out of my ROM and look at it, it will probably make more sense than that ram dump.Bottom line each .img or partition setup is proceded by it size and then offset into the ROM file. For instance 0x00002000@0000000(boot), 0x00080000@00002000(kernel), 0x0004000@00082000(cache)
The number is the size@offset. So first img starts at 0 and is 2000 is size. The the next one after it starts at offset 2000 and is 80000 in size. So on and so forth.
Bob
Hi BOB.
I do have a question for you. (sorry for my English in advance)
I found that my tablet is extremely slow, because of some kind bad nand/flash.
Wen I start to copy a a file (over usb from PC for example) until 2GB are passed the write speed is 300-400kb/s If 2GB are already passed/coppyed the speed skyrockets to 3-4Mb/s.
So I want to ask you, is it possible to edit the parameter file manually is such a way that I "skip" and do not use the initial lets say 4Gb.
My idea is to be something like:
Unused free space - boot - kernel- misk - data -user and so on and so on. Right now the partitions are started by offset 0.
Are you able to give me an example? here is the content of my file:
CMDLINE:console=ttyFIQ0 androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x00006000@0x00004000(kernel),0x0000E000@0x0000A000(boot),0x00010000@0x00018000(recovery),0x00020000@0x00028000(backup),0x00040000@0x00048000(cache),0x00400000@0x00088000(userdata),0x00002000@0x00488000(kpanic),0x00100000@0x0048A000(system),-@0x0058A000(user)
Most Users Ever Online: 803
Currently Online:
49 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Devices in use: Desktop (42), Phone (7)
Top Posters:
finless: 604
DarthJabba: 551
maikal: 394
mussonero1: 350
alex: 252
damo: 243
DanielVd: 237
Mark06: 222
Newest Members:
nkkq98
totypraca
morgotrond
create99
torile
wogoko8553@yubua.com
Forum Stats:
Groups: 10
Forums: 185
Topics: 6037
Posts: 60500
Member Stats:
Guest Posters: 43
Members: 262194
Moderators: 5
Admins: 1
Administrators: admin
Moderators: globula_neagra, exelletor, JochenKauz, Oma7144, cracktech
CrewRKTablets moderators: JochenKauz and Astralix