You can add your own lcd init function. Use hw_fd5420.c -> Fd5420_PowerOnInit as a reference and take the above disassembly to fill in the correct values. Here is an example:
I'm a new user of Rockchip players.
My one is Rizone hacked "32GB" (actually 4GB), and the chip is RK2705 (almost equal to RK2706).
It has 400x240 touchscreen, microsd slot and 4 buttons (+reset).
I've put my firmware here: http://www.mediafire.com/chiprocker
What I've found by now:
1) The player supports SDHC class6 cards (mine is 8GB).
2) It's easy to compile the firmware using RK27SDK, but it doesn't work on player.
Haven't tested the emulator yet.
3) It's easy to use SDK to compile RKW file from original firmware folders you've dumped from your player.
This way the process of recovery with RK27DM becomes very easy.
4) Inside the player I've found a 24MHz quartz; however, there's a 12MHz value in SDK files. Maybe, it should be changed.
I'm rather experienced C/C++ coder and I'm interested in good firmware for the player too. Maybe I'll try porting roxkbox when we collect some more info.
Alemaxx, how do you work with firmwares in IDA?
Last edited by ChipRocker; 19th Sep 2009 at 7:47 am.
hi ChipRocker. Welcome. The more members who can help out the better, we are in need of anyone with c/c++ experience.
We have a lot of information already we just need to get enough members with the right experience interested.
Quote:
It's easy to use SDK to compile RKW file from original firmware folders you've dumped from your player.
not tried that, how did you do it? I could do with a RKW recovery firmware.
Quote:
You can add your own lcd init function. Use hw_fd5420.c -> Fd5420_PowerOnInit as a reference and take the above disassembly to fill in the correct values.
Thank you very much AleMaxx I'll try it out, I think it ought to work.
Hi ChipRocker,
yes, I use IDA and sometimes arm-elf-objdump. If you have IDA, load the BASE.RKW as embedded rom-image, choose ARM architecture and load address (ROM) 0x5FFFFFD4. When its loaded go to location 0x60000000 and press 'c'. This should give you a branch (/jump) to some code thats installs the ARM exception handlers. Following the reset vector directs you to the firmwares main(). By comparing the disassembly with the source from the SDK (rename those sub_XXX by pressing 'n') its quite easy to make sense out of it. For a more detailed description have a look at this: RKW Firmware Patching (dont use that patching program on the page).
Btw, Im also working on getting a real firmware running on the rk27 platform to get rid of this ultra crappy RockOS. So far I was aiming at ucLinux. I didnt get the UART working, so development is going really slow. A major step would be to get some virtual UART via USB (using CDC and ACM). I already found code for a virtual usb uart implementation for another platform but this doesnt seem to become easy at all (at least for me).
Looking at your disassembly I've found similiar code in my own firmware.
And...... the code is from hw_Ili9320.c!
Hmm... that means my code is already used when building firmware...
Last edited by ChipRocker; 19th Sep 2009 at 11:01 am.
Hi ChipRocker,
so the firmware you build ends up as an .RKW file and if you copy it to the System folder it does not get executed? What exactly does happen? In my first attempts to write my own code I modified a firmware internal filename ("HOLDON.BIN") to get some feedback. The firmware will write to/create this file when the player is turned off. You could compare the disassembly of your built against the original firmware maybe using
Another issue maybe that the crc32 codes (for header and/or code) of your new BASE.RKW are incorrect this would prevent the loader from executing it but I think it will load the backup version from "SYSTEM00" folder instead. Compatible crc32 generation code can be found in that rkwpatch.c thats available from the link I did mention earlier.
Wait, did you check whether you have an 16bit or 18bit interfaced lcd? Locate that transform function thats called from within mcu_writereg and then its a matter of 0xFC00 or 0x3F00 iirc.
Regards
Last edited by AleMaxx; 19th Sep 2009 at 12:44 pm.
When I use the base.rkw built with sdk, and try turning the player on, it just gives a single flash of backlight and does nothing more.
Reset gives the same reaction. However, when plugging USB in, the screen shows a few lines of crap, and the player gives access to all disks.
Looks like a problem is not in screen init, but it's more fundamental.
Yes, I'm comparing the firmwares using IDA. Looks similiar, but there are differences. Continue digging...
No, I don't think the problem is in CRC; if you try running 'version.exe -F:base.rkw' it says, that CRC32 is ok.
Okay, I dont have anymore ideas but to actually confirm that the initialization is okay you could try changing the fill color in the last part of the init to something else then black possibly adding a "delay_nops" after or inside the loop. Btw, there is some more code in the lcd init procedure that gets executed afterwards and prevents access to the screen via mcu_xxx routines. If you out comment these lines:
(I slightly renamed the function names) mcu_xxx comands will still allow you to access the screen (maybe useful if you want to output messages to the lcd). I have some font code that works this way, I could upload it if you think it may be useful.
Oh, I've mistaken a bit.
The code was just _like_ in hw_Ili9320.c, but actually not the same.
I've spent about an hour rewriting this file using the disassembly of original firmware, and now what.... I have the screen working!!!
The player still doesn't start with play button - just flashes backlight (any ideas?).
BUT when I plug in usb, it gives access to disks, and shows random pictures (the order is wrong) from resources on red background!!
That means that the screen init function works OK!!