rockchip-linux / u-boot

U-Boot tree for pending commits
126 stars 86 forks source link

rk3126 not working #47

Open Janrupf opened 5 years ago

Janrupf commented 5 years ago

Information

I'm dealing with a (kind of) bricked tablet based on a rk3126. I can flash images and get into MASKROM and everything, so the board itself is fine. However, I can't get the combination of the rockchip tools to produce anything usable. The board seems to boot from the SD, or at least tries to do so. I erased the internal flash completly, so when no SD is plugged in the board boots into MASKROM. I also have the original partitions and parameter files around, but flashing them back does not work. (Board wont boot)

How I tried to do it

# Packaging the idbloader for SD boot
# Note that I'm using rk3128 because the rk3126 is not supported,
# but I guess they are nearly the same
$> u-boot-rockchip/tools/mkimage -n rk3128 -T rksd -d rkbin/bin/rk31/rk3126_ddr_300MHz_v2.09.bin idbloader.img
Image Type:   Rockchip RK31 (SD/MMC) boot image
Data Size:    4096 bytes

# Packaging the uboot.img
# I think the load address 0x4000 is correct?
$> u-boot-rockchip/tools/loaderimage --pack --uboot u-boot-rockchip/u-boot.bin uboot.img 0x4000

 load addr is 0x4000!
pack input u-boot-rockchip/u-boot.bin 
pack file size: 780357(762 KB)
crc = 0x21ad0872
uboot version: U-Boot 2017.09-03647-gcb560f1934-dirty (Oct 18 2019 - 20:09:36)
pack uboot.img success! 

# Writing the idbloader to the SD card
$> sudo dd if=idbloader.img of=/dev/sdc seek=64
240+1 records in
240+1 records out

# And writing U-Boot
$> sudo dd if=uboot.img of=/dev/sdc seek=16384
8192+0 records in
8192+0 records out
4194304 bytes (4.2 MB, 4.0 MiB) copied, 2.46971 s, 1.7 MB/s

# Sync for safety
$> sync

Results

Thats what I execute, and it somehow makes to the tablet try to boot from the SD. There is however no display output and the device doesn't show up using lsusb. I have no idea what I can do, I at least expected to be able to see the device over USB when booting with U-Boot since there is no Kernel and RootFS and thus U-Boot can't continue.

I slightly modified the U-Boot compilation via make menuconfig, but all in all I based it on the rk3126 defconfig. Any idea what might be wrong or any tips how I can debug that?

jaydcarlson commented 4 years ago

I know this is a year later, but did you ever get this working? It sounds like it's at least starting to load U-Boot (since it doesn't go into the ROM bootloader mode). Do you have a UART console connected so you can monitor serial messages?

Janrupf commented 4 years ago

To be honest, I think I bricked the device I experimented with (possibly damaged flash chip, not sure). It was a cheap china tablet, so there is no real documentation about it. I have no experimented with it for quite a while, and I didn't find headers to connect an UART to.

However, if you think there is a way this can be tested, and maybe even debugged (I don't have enough experience), I'd be happy to get in touch.

mykhani commented 3 years ago

I've had to do the same recently. In case somebody needs it, the steps for packaging the binaries given above are correct except the uboot.img load address. Instead of 0x4000, it should be 0x60000000. According to the instructions at http://opensource.rock-chips.com/wiki_Boot_option for packaging the uboot.img.

tools/loaderimage --pack --uboot u-boot.bin uboot.img $SYS_TEXT_BASE

The value of SYS_TEXT_BASE for rk3126 can be found by grepping for 'CONFIG_SYS_TEXT_BASE' inside u-boot sources. It is defined in file include/configs/rk3128_common.h as #define CONFIG_SYS_TEXT_BASE 0x60000000

I gathered some of the stuff for rk3128 and rk3126 can be used interchangeably (they both seem compatible) so I gave it a shot and it worked.

ghost commented 3 years ago

Thank you mykhani, I could find the correct CONFIG_SYS_TEXT_BASE value for my rk3328 board this way.

include/configs/rk3328_common.h:#define CONFIG_SYS_TEXT_BASE 0x00200000

Vinicius769020 commented 1 year ago

Hello, i'm so new in this so, i can't know how to do this, a complete flash image will be so precious to me, or, at least, you can help me with my tablet too... thx in advance! My tablet is a rk3126 based, with 1gb of ram

waldopulanco commented 1 year ago

sorry for replying to this topic, I have a problem to my tv box running rk3128, the board itself is fine no hardware problem. the problem is I accidentally flash the bootloader with different version for kr3128. and after that it is in maskrom mode and cant get into loader mode. I tried many version of bootloader for rk3128 from miniloader version 2.17 up to 2.47 but after flashing of bootloader it always in maskrom mode. it cannot enter on loader mode. I need to enter on loader mode to flash my bsckup firmware but no backup bootloader. I cant find miniloader for rk3128 higher than v2.47 or even compatible bootloader to bootup in loader mode, I dont know what is the right version of miniloader for my rk3128 tv box. thanks in advance! I have a video on youtube about my problem https://youtu.be/ilFpGAqvuQU