Giter Site home page Giter Site logo

flatmax / buildroot.rockchip Goto Github PK

View Code? Open in Web Editor NEW
51.0 6.0 21.0 5.48 MB

buildroot external for rockchip boards

License: Other

Shell 66.06% Makefile 17.38% Batchfile 13.52% C 3.05%
buildroot buildroot-external rockchip single-board-computer gtkiostream

buildroot.rockchip's Introduction

RK3308, RK3328, RK356X, RK3588 buildroot system

Now builds for rk3308, rk3328, RK3566 and RK3588

This repo generates a bootable sdcard image for the RK3xxx platform. It is a 64 bit image. Based on buildroot, this directory is an external buildroot tree - it integrates into the main buildroot tree seamlessly.

For the RK3399 buildroot images, have a look at this dedicated repo : https://github.com/flatmax/buildroot.rk3399.external

Initial setup

Clone buildroot. For example :

cd yourPath
git clone git://git.busybox.net/buildroot buildroot

# rock pi S tested with version : git checkout 2022.02.1
# rock pi 3a tested with version : git checkout 2022.08.1
# rock cm3 tested with version : git checkout 2022.08.2
# rock 5b tested with version : git checkout 2022.05

Make sure you have requirements :

sudo apt-get install -y build-essential gcc g++ autoconf automake libtool bison flex gettext
sudo apt-get install -y patch texinfo wget git gawk curl lzma bc quilt swig

If building in a minimal Docker image, you will also require :

sudo apt-get install -y cpio unzip rsync python3

If building for the cm3 and rock3 derivatives (and possibly others), you will need a minimal python2 system :

sudo apt install python2

The above instructions apply to Debian-based distros. Buildroot works on other distros, but installing the above dependencies is beyond the scope of this README; check your distro's package manager documentation. Additionally the dash shell is required on distros where it is not the default.

Clone the external buildroot tree :

git clone https://github.com/flatmax/buildroot.rockchip.git buildroot.rockchip.ext

To make the system

# For the RockPi S
source buildroot.rockchip.ext/setup.rockPiS.sh yourPath/buildroot
# for the Radxa rock 3 a board
source buildroot.rockchip.ext/setup.rock3a.sh yourPath/buildroot
# for the Radxa rock 5b board
source buildroot.rockchip.ext/setup.rock5b.sh yourPath/buildroot
# for the Radxa rock cm3 io board
source buildroot.rockchip.ext/setup.cm3.sh yourPath/buildroot
# For the RockPi E (rk3328 based board) [needs more work]
source buildroot.rockchip.ext/setup.rockPiE.sh yourPath/buildroot
# For the Pine64 Quartz64 (rk3566 based board) [currently not working]
source buildroot.rockchip.ext/setup.quartz64.sh yourPath/buildroot

Make sure you have the buildroot downloads directory present (when you are in the yourPath/buildroot directory execute the following) :

mkdir ../buildroot.dl

build the system

rock3a build

rkbin must be built before uboot and the kernel as they depend on rockchip binaries from this package, run the following before running a full make

make rkbin

general build

make

installing

Insert your sdcard into your drive and make sure it isn't mounted. Write the image to the disk.

NOTE: The following command will overwrite any disk attached to $OF. Don't overwrite your root.

OF=/dev/sdf; rootDrive=`mount | grep " / " | grep $OF`; if [ -z $rootDrive ]; then sudo umount $OF[123456789]; sudo dd if=output/images/sdcard.img of=$OF; else echo you are trying to overwrite your root drive; fi

using

Connect to the console debug uart with a serial cable. Or, add the openssh-server pacakge to the buildsystem, then ssh in as user root, no pass.

ssh RSA keys

To use ssh, put your id_rsa.pub into the authorized_keys in the overlays directory. This will autoload your public RSA key to the embedded system so that you can login.

$ mkdir -p overlays/root/.ssh; chmod go-rwx overlays/root/.ssh
$ ls -ld overlays/root/.ssh
drwx------ 2 me me 4096 Aug  3  2016 overlays/root/.ssh
$ cat ~/.ssh/id_rsa.pub > overlays/root/.ssh/authorized_keys
$ ls -l overlays/root/.ssh/authorized_keys
-rw-r--r-- 1 me me 748 Feb 24 11:17 overlays/root/.ssh/authorized_keys

TODO

for the rk3308 board

Try to find suitable rock-chip boot binaries on github. rk3308_ddr_589MHz_uart0_m0_v1.26.bin can't be found in rkbin. Shift uboot and the kernel to mainline Linux.

buildroot.rockchip's People

Contributors

dflogeras avatar flatmax avatar gasb0 avatar haelyons avatar pfremm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

buildroot.rockchip's Issues

CM3 does not boot

I'm using a Radxa CM3 module on a Raspberry Pi CM4 IO Board.
I built the image as described, and flashed it onto the internal eMMC.
The board starts U-Boot SPL, but then hangs after verifying the checksums:

[Skip DDR Initialization Block]

U-Boot SPL board init
U-Boot SPL 2017.09 (Sep 13 2022 - 17:35:53)
unknown raw ID phN
unrecognized JEDEC id bytes: 00, 00, 00
TryMMC error: The cmd index is 1, ret is -110
Card did not respond to voltage select!
mmc_init: -95, time 10
spl: mmc init faileerror: -95
Trying to boot from MMC1
## Verified-boot: 0
## Checking uboot 0x00a00000 ... sha256(87fbe2d509...) + OK
## Checking fdt 0x00b2e3e8 ... sha256(2154df9e4a...) + OK
## Checking optee 0x08400000 ... sha256(b8cddafab0...) + OK

I also tried to write the image onto an sdcard, but that didn't work as well (maybe a different dtbo is needed). Even if it worked on an external sdcard, I would like it to boot from the internal eMMC.

can't find the file path/rk3308_defconfig please fix this script

I followed the steps to build, however I have the same result for the rk3308 chip and the others.

➜  $ tree -L 1
├── buildroot
└── buildroot.rockchip.ext

rock pi S tested with version : git checkout 2022.02.1 ok

exec command

➜  $ source buildroot.rockchip.ext/setup.rk3308.sh buildroot          
can't find the file /home/castro/kernel-rock/configs/rk3308_defconfig
please fix this script

as defconfig already exists in buildroot, it worked. I already apologize if I'm doing something wrong.

a repository not exist, and file on sources.buildroot.net not exist

I try to build on radxa rock 3a, but failed.
I followed the instructions, in the step "Now build buildroot as per usual", can't finish make.

problem 1:
remote: Repository not found.
fatal: 仓库 'https://github.com/rockchip-linux/device-custom.git/' 未找到
...
This is the second time in a row; bailing out

problem 2:
--2022-02-27 19:54:59-- http://sources.buildroot.net/rkdevice-0fe366cf14a6d5d552a5bddbc7b8ff58260ae6e6-br1.tar.gz
正在解析主机 sources.buildroot.net (sources.buildroot.net)... 104.26.1.37, 104.26.0.37, 172.67.72.56, ...
正在连接 sources.buildroot.net (sources.buildroot.net)|104.26.1.37|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 404 Not Found

It seems that that repository and that file don't exist. How can I fix this problem?

Build unknown mraa platform

When the lib mraa is installed with apt it receives this MRAA version (v2.1.0-22-gb24cd50) on the Radxa ROCK Pi S.

  • When done using buildroot, the version looks like this. Version 2022.02.1 on Unknown platform

code

#include <iostream>
#include <mraa.hpp>

int main() {
    // Inicializar o barramento I2C
    mraa::I2c i2c(0);  // O número 0 refere-se ao barramento I2C 0

    // Verificar se o barramento I2C foi inicializado corretamente
    if (!i2c.address(0x0A)) {
        std::cerr << "Erro ao inicializar o barramento I2C" << std::endl;
        return 1;
    }

    // Ler um byte do dispositivo no endereço 0x0A
    uint8_t dataRead;
    if (i2c.read(&dataRead, 1) != mraa::SUCCESS) {
        std::cerr << "Erro ao ler do dispositivo I2C" << std::endl;
        return 1;
    }

    std::cout << "Valor lido: " << static_cast<int>(dataRead) << std::endl;

    return 0;
}
  • The code above runs normally in the debian version, in the version with buildroot I have this error
# ./i2c-list 
terminate called after throwing an instance of 'std::invalid_argument'
  what():  Invalid i2c bus
Aborted

Using, it ok

# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- 0a -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

I don't know if it's appropriate to open an issue here, but I would like to compile this mraa lib to run on my image. can you help me ?

About errors when building buildroot for rock3a

1.I meet the error "[email protected]: Permission denied (publickey)" when running "git clone [email protected]:flatmax/buildroot.rockchip.git buildroot.rockchip.ext"
I choose to run "git clone https://github.com/flatmax/buildroot.rockchip.git buildroot.rockchip.ext"
2.I meet the error when I run "make rkbin". Makefile.legacy:9: *** "You have legacy configuration in your .config! Please check your configuration."。
I guess it is because of the version of the buildroot but I can't correct it.

Rock Pi S

Hi there, first thanks for your efforts. I'm attempting to build an image for the rock pi s. I found the missing .bin files from the TODO here:

https://github.com/radxa/rkbin/tree/master/bin/rk33

and managed to get it to produce a sdcard.img. However, when I put that on an sdcard, no boot activity happens. I have a usb -> uart bridge plugged into the appropriate pins (at least for the radxa stock debian image).

This is on v12 hardware.

I started with buildroot 2022.02.1 and 80af258 of this repo.

Any suggestions would be very welcomed.

Unable to boot on Rock 3A

Hi there, built this successfully on WSL2 (Win11) today but have been unable to boot from SD card. Could this be an issue with the flashing mechanism? Why do the instructions state to unmount the disk before using dd?

As I am developing in WSL2 I flashed the sdcard.img using BalenaEtcher (and also tried with Rufus, and several SD cards). I can confirm that the Rock 3A is working both with Ubuntu and Debian images provided by Radxa.

Thanks for this repo :)

libyaml missing

I'm trying to build the quartz64_defconfig, but building linux fails because it cant find libyaml. I have tried installing and uninstalling libyaml-dev on the host. I'm not sure what else to do.

dtc needs libyaml for DT schema validation support. Install the necessary libyaml development package

failed to build rock5b

following the instruction in READE for build rock5b, got below error

  CC      examples/standalone/hello_world.o
  LD      examples/standalone/hello_world
  OBJCOPY examples/standalone/hello_world.srec
  OBJCOPY examples/standalone/hello_world.bin
  LDS     u-boot.lds
  LD      u-boot
/root/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: arch/arm/mach-rockchip/built-in.o: in function `fdt_fixup_modules':
/root/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164: undefined reference to `_u_boot_list_2_driver_2_rockchip_otp'
/root/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: arch/arm/mach-rockchip/built-in.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_u_boot_list_2_driver_2_rockchip_otp' which may bind externally can not be used when making a shared object; recompile with -fPIC
/root/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164:(.text.rk_board_dm_fdt_fixup+0xc): dangerous relocation: unsupported relocation
/root/buildroot/output/host/bin/aarch64-buildroot-linux-uclibc-ld.bfd: /root/buildroot/output/build/uboot-stable-5.10-rock5/arch/arm/mach-rockchip/rk3588/rk3588.c:1164: undefined reference to `_u_boot_list_2_driver_2_rockchip_otp'
make[2]: *** [Makefile:1284: u-boot] Error 1
make[1]: *** [Makefile:461: __build_one_by_one] Error 2
make[1]: Leaving directory '/root/buildroot/output/build/uboot-stable-5.10-rock5'
make: *** [boot/uboot/uboot.mk:533: /root/buildroot/output/build/uboot-stable-5.10-rock5/.stamp_dotconfig] Error 2

rock3a v1.31 doesn't boot

Not sure why, but this system works for the rock3a v1.3. It doesn't seem to boot for the rock3a v1.31

Rockchip RK3568B2 SPL partition issue.

Hi , I am working on a Banana Pi R2-Pro. I am getting the following error on the serial console at boot:
"...

Trying to boot from MMC2
No misc partition
spl: partition error
Trying fit image at 0x4000 sector

Verified-boot: 0

Checking uboot 0x00200000 ... sha256(b8816e87e3...) + OK

Checking fdt 0x00309860 ... sha256(d32827d3ac...) + OK

"

This is after it tries to read the (not useful) info on the emmc (MMC1).
Note however, that this is much farther than I could get using anything from SinoVOIP.

Any advice or assistance would be most welcome.

Thanks,

Erik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.