BPI R2 LEDE(openwrt) source code

@garywang Hi ,i got problem with latest lede i got error

/make_bundle_image.sh /home/pkalemba/bpi-r2_lede/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/mtk-bpi-r2-SD.img /home/pkalemba/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_mu sl_eabi/image/mtk-bpi-r2-preloader-sd.bin /home/pkalemba/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/mtk-bpi-r2-uboot.bin /home/pkalemba/bpi-r2_lede/build_dir/target-arm_cortex-a7+neo n-vfpv4_musl_eabi/linux-mediatek_32/uImage-mt7623n-bananapi-bpi-r2 /home/pkalemba/bpi-r2_lede/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/root.squashfs

  • ‘[’ 5 -eq 5 ‘]’
  • OUTPUT_FILE=/home/pkalemba/bpi-r2_lede/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/mtk-bpi-r2-SD.img
  • PRELOADER_FILE=/home/pkalemba/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/mtk-bpi-r2-preloader-sd.bin
  • UBOOT_FILE=/home/pkalemba/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/mtk-bpi-r2-uboot.bin
  • KERNEL_FILE=/home/pkalemba/bpi-r2_lede/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/uImage-mt7623n-bananapi-bpi-r2
  • ROOTFS_FILE=/home/pkalemba/bpi-r2_lede/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/root.squashfs
  • BS=1024
  • PRELOADER_OFFSET=0
  • UBOOT_OFFSET=320
  • KERNEL_OFFSET=2048
  • ROOTFS_OFFSET=66816
  • dd bs=1024 if=/home/pkalemba/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/mtk-bpi-r2-preloader-sd.bin of=/home/pkalemba/bpi-r2_lede/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eab i/linux-mediatek_32/mtk-bpi-r2-SD.img seek=0
    dd: failed to open ‘/home/pkalemba/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/mtk-bpi-r2-preloader-sd.bin’: No such file or directory

I assume there is a problem wtih uboot-mtk-bpi-r2 package but i cannot get it built.

I have same problem. It just abort before build image of SD card. But the uImage-mt7623n-bananapi-bpi-r2 and root.squashfs has been build in ./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32. So you can just use that two file and flush it into your R2 board follow this:

btw. Do you update the feeds after 2018/1/1? Another preblem is libuci-lua (>= 2018-01-01). You need download the Makefile and uci.sh in lesource/package/system/uci at master · lede-project/source · GitHub and replace same file in ./package/system/uci.

Or maybe update code please, garywang. :wink:

Do you update the feeds after 2018/1/1? Another preblem is libuci-lua (>= 2018-01-01). You need download the Makefile and uci.sh in lesource/package/system/uci at master · lede-project/source · GitHub and replace same file in ./package/system/uci.

@BoringCat yes , i just changed by hand package version in Makefile of uci and it works :slight_smile:

I know method with TFTP but i seen that is option to buld SD card ready image so i tried it and it fail.

Sorry, I’m trying to bundle preloader/uboot/kernel/rootfs as an image, but this feature isn’t done yet, please use the code based on previous commit.

Sorry for this.

Gary

hi i did all the step at the first post but the systen hyng at boot, the last what i see is

on my build system i did:

git clone https://github.com/garywangcn/bpi-r2_lede.git cd bpi-r2_lede

./scripts/feeds update -a ./scripts/feeds install -a

cp …/config ( the attached config from the first post ) ./.config make menuconfig -> exit -> did the save

make after a while the the complie proccess is finished without error then cd build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32 scp root.squashfs uImage-mt7623n-bananapi-bpi-r2* root@mytftpserver:/tftproot

then on the bpi-r2 the step with the uImage-mt7623n-bananapi-bpi-r2.initramfs ( see below at the quote )

please help

holger

@mark05 did you change branch? you need to

git checkout bpi-r2-on-lede-v1

after you clone

@garywang i build the latest version flashed mtk-bpi-r2-SD.img to SD Card and i got error

Rank 0 coarse tune value selection : 31, 31         
Cannot find any pass-window                         
DRAMC calibration takes 398149594 CPU cycles        

[EMI] DRAMC calibration failed                      

[MEM] complex R/W mem test fail :FFFFFFFF           
<ASSERT> memory.c:line 109 0                        
[PLFM] preloader fatal error...

even if i update uboot package to latest commit.

Hi Pkalemba

Please don’t use the mtk-bpi-r2-SD.img, we are trying to bundle preloader/uboot/kernel/root file system as an image, but it’s not ready. Sorry for this.

hi

i did an fresh clone

but there ist no branch bpi-r2-on-lede-v1

holger

strange online there is that branch…have you defined any options for git to get only the master branch?

Garys repo has newer code…

hi there are no options set at git , it is a fresh install debian ( devuan ) system just for bpi r2 source code compile

ithe is no .git at all.

in my browser i see the diffrent branch bt i i do the git clone with https i get only the master branch

so [update]

i did an

git branch -a ( got )

  • master remotes/origin/HEAD -> origin/master remotes/origin/bpi-r2-on-lede-v1 remotes/origin/lede-17.01 remotes/origin/master

then

git checkout remotes/origin/bpi-r2-on-lede-v1 git pull https://github.com/garywangcn/bpi-r2_lede.git bpi-r2-on-lede-v1 git checkout bpi-r2-on-lede-v1

i start the make

holger

holger

hi

make fails with

  • ROOTFS_FILE=/home/glaess/bpi-r2_lede/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/root.squashfs
  • BS=1024
  • PRELOADER_OFFSET=0
  • UBOOT_OFFSET=320
  • KERNEL_OFFSET=2048
  • ROOTFS_OFFSET=66816
  • dd bs=1024 if=/home/glaess/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/mtk-bpi-r2-preloader-sd.bin of=/home/glaess/bpi-r2_lede/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/mtk-bpi-r2-SD.img seek=0 dd: failed to open ‘/home/glaess/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/mtk-bpi-r2-preloader-sd.bin’: No such file or directory Makefile:12: recipe for target ‘install-images’ failed make[5]: *** [install-images] Error 1 make[5]: Leaving directory ‘/home/glaess/bpi-r2_lede/target/linux/mediatek/image’ Makefile:21: recipe for target ‘install’ failed make[4]: *** [install] Error 2 make[4]: Leaving directory ‘/home/glaess/bpi-r2_lede/target/linux/mediatek’ Makefile:13: recipe for target ‘install’ failed make[3]: *** [install] Error 2 make[3]: Leaving directory ‘/home/glaess/bpi-r2_lede/target/linux’ target/Makefile:23: recipe for target ‘target/linux/install’ failed make[2]: *** [target/linux/install] Error 2 make[2]: Leaving directory ‘/home/glaess/bpi-r2_lede’ target/Makefile:19: recipe for target ‘/home/glaess/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.target_install’ failed make[1]: *** [/home/glaess/bpi-r2_lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.target_install] Error 2 make[1]: Leaving directory ‘/home/glaess/bpi-r2_lede’ /home/glaess/bpi-r2_lede/include/toplevel.mk:207: recipe for target ‘world’ failed make: *** [world] Error 2

holger

as gary said: do not use mtk-bpi-r2-preloader-sd.bin…

you can try to move back with

git checkout commit-id

commit-overview

e.g. using 51b0bac as commit-id

hi thanks for help

please be sorry for my missing knowledge about git .

i have to learn … about git and the bpi-r2

holger

hi

kernel build susccessful an bpi-r2 boots him but i miss the wifi interface.

holger

Iassume you must start wifi driver with wmt-tools like in debian/ubuntu.

Please use the latest code, thanks.

Latest souce code of OpenWRT(LEDE)

source code(Please note that the branch is bpi-r2-on-lede-v1)

Configurion of LEDE

TARGET=MediaTek Ralink ARM Boot Loaders=u-boot-bpi_r2 (This option is mandatory) …

How to build

make -j1 V=s

Images

when above steps is done, we will below two images under /build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/:

  • mtk-bpi-r2-EMMC.img
  • mtk-bpi-r2-SD.img

How to use SD image

A SD card is requried and then install mtk-bpi-r2-SD.img to SD card by running below command:

dd if=mtk-bpi-r2-SD.img of=/dev/sdb

where /dev/sdb is the SD card.

And then install the SD card to R2 board, power it on, the board will boot from SD card.

How to use EMMC image

We need another system which is running on SD card to program EMMC image to EMMC, please follow below steps to do:

1. Copy EMMC image to a running system which is on SD card
2. Program EMMC image to User Data Area of EMMC: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0
3. Unlock EMMC boot0 block: echo 0 > /sys/block/mmcblk0boot0/force_ro
4. Program preloader to EMMC boot0 block:
     dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0boot0 bs=1M count=1
5. Change the Partition configurion of EMMC is 48h: reboot the system which is running SD, and enter the U-boot command line, run command
    emmc pconf 48
6. Power off, remove SD card, and then power on R2 board.

Hello together,

i successfully flashed build Reboot (SNAPSHOT, r4768-b1d4a37) from @garywang to my Banana R2 board. Now i have some questions:

  1. Is it right that WAN Port isn’t working at the moment? (what is the reason / what is to do?)
  2. Is there a way to get Internet without the WAN port ?

Thank you a lot.

Greets Anton

The WAN and br-lan should be working fine, please follow below steps. I think we can get internet via br-lan or wireless, and so on, this depends on you purpose…

Instruction

Please remove the configuration for lan and wan in /etc/config/network, and then add below lines in that file.

config interface 'lan'
      option type 'bridge'
      option ifname 'lan0 lan1 lan2 lan3'
      option proto 'dhcp'

config interface 'wan'
      option ifname 'wan'
      option proto 'dhcp'

Hey @garywang, I into bananpi r2 from last few hours. I am linux developer and would like to contribute to make better OpenWRT/LEDE functional on this board. Few points: What are you current working on? What I can do here for banana pi r2?

And by “Program preloader to EMMC boot0 block:” do you mean to replace current bootloader?