Android sys_config customization and peripherals

It should be the same as outlined here for H3, they use nearly the same BSP. To get the ‘SDK’ grab SinoVoip’s M3 BSP and make your modifications in the right place.

1 Like

Thanks a lot ! That’s great, it did the trick :).

So, for anyone having the same problem that I had, modifying only the sys_config with a fex2bin pass in the “extracted” img and then rebuild it is not enough. You also need to update the boot0_sdcard.fex file as it seems to pack the sys_config and other stuff (I did copy the other files, but it may not be necessary).

Hello kailokyra

I’m also using Android on the M3 and want to use the UART’s of the GPIO can you tell me step by step what you did to get it to work on your setup maybe I could use it for my setup also i want to hookup a gps using the UART’s

Hi,

Step by step it would be something like :

  • Clone SinoVoip’s M3 BSP on their github ( https://github.com/BPI-SINOVOIP/BPI-M3-bsp )

  • Clone and compile sunxi-tools (in fact, you just need fex2bin) on the sunxi github ( http://linux-sunxi.org/Sunxi-tools )

  • Get imagerepacker 2.05 ( http://forum.xda-developers.com/showthread.php?t=1753473 )

  • Get LiveSuit ( http://linux-sunxi.org/LiveSuit#Debian.2FUbuntu )

  • Extract the android image file for BPI M3 (.img) with imgRepacker

  • Now that you have all that, build uboot by running the build script at the root of the bsp repo

  • go in the sunxi-pack folder and do :

  • edit the chips/sun8iw6p1/configs/BPI_M3_1080P/sys_config.fex file (or in any other BPI_M3_x folder, there’s 4 of them). Here, you need to go to the uart configuration section. The different options are self-explanatory so just set “used = 1” to the uart 2 / 3, with the correct number of wires as you wish.

  • Note that you have the port mapping, with the multiplexed function selected ect in the form “port:PB00< mux_function >”. (0 for GPIO input, 1 for output, function definitions on this link Banana pi BPI-M3 GPIO define starting from 2 to 7)

  • You have to remove the GPIO pin “device” corresponding to every pin used by a peripheral (so for UART 2, remove the line using PB00 and PB01 in the “gpio configuration” section.

Now that it’s done, You’ll need to execute something in this fashion in the sunxi-pack directory (replace with your own paths) :

mkdir out cp chips/sun8iw6p1/configs/BPI_M3_1080P/sys_config.fex out/sys_config.fex cp chips/sun8iw6p1/bin/boot0_sdcard_sun8iw6p1.bin out/boot0_sdcard.fex perl -i -p -e ‘s|[\r\n]+|\r\n|g’ out/sys_config.fex pctools/linux/mod_update/script out/sys_config.fex …/…/sunxi-tools/fex2bin out/sys_config.fex out/sys_config.bin pctools/linux/mod_update/update_boot0 out/boot0_sdcard.fex out/sys_config.bin SDMMC_CARD cp chips/sun8iw6p1/bin/u-boot-sun8iw6p1.bin out/u-boot.fex pctools/linux/mod_update/update_uboot out/u-boot.fex out/sys_config.bin cp out/* ~/BPI-M3_Android_HDMI_V2.img.dump/ cd ~/BPI-M3_Android_HDMI_V2.img.dump/ mv sys_config.bin config.fex cd ~ ./imgrepacker ~/BPI-M3_Android_HDMI_V2.img.dump

And, tada ! You got yourself a modified android image, ready to be flashed with Livesuite !

Hooking up a gps is straightforward if it’s a simple GPS module with a serial input/output. I know that there’s also a section in the .fex concerning a gps, but I don’t know more about it : )

4 Likes

Question 1:what this "…/…/sunxi-tools/fex2bin out/sys_config.fex out/sys_config.bin " mean? Question 2:what this “pctools/linux/mod_update/update_boot0 out/boot0_sdcard.fex out/sys_config.bin SDMMC_CARD” mean? especially the SDMMC_CARD? hope for your answer,thank you.

For your first question, it’s the sunxi-tools utilities that you have to get on https://github.com/linux-sunxi/sunxi-tools and compile it. Then it’s just passing sys_config.fex to the fex2bin so that it outputs a sys_config.bin.

For your second question, it’s an utility that you can find in the pctools/linux/mod_update folder in the bsp. you have to pass the path to the boot0.fex file and the sys_config.bin. I guess the SDMMC_CARD parameter is to specify that you want the boot mode to be set on SD/MMC, (I’m not certain of that, it’s just a supposition, so take that as is. It just happen that the other one didn’t work :slight_smile: )

Thank you, kailokyra ! Also i have some questions,hope for you answer. question 1:“cp out/* ~/BPI-M3_Android_HDMI_V2.img.dump/” this meas copy the file out to the xxx.img.dump? The file “out” keep the state of file in the xxx.img.dump?
question 2:“cd ~/BPI-M3_Android_HDMI_V2.img.dump/ mv sys_config.bin config.fex” these two command meas open the file of xxx.img.dump and move sys_config.bin config.fex?

Change the sys_config will help me add the GPS module to the GPIO pins? Thank you once again!

For your first question, the “out” and “BPI-M3_Android_HDMI_V2.img.dump” are not simple files, they are folders. It’s just doing a copy of everything that is in the folder “out/” into the folder “BPI-M3_Android_HDMI_V2.img.dump/”. It may replace some files, but it’s fine because you need them to be replaced anyway.

For your second question, it means "change the current directory to “BPI-M3_Android_HDMI_V2.img.dump/”, then replace the file named “config.fex” by the file “sys_config.bin”. (or copy over).

:slight_smile:

Regarding the use of the GPS, it may be useful to edit the sys_config if your module outputs its data via a serial link, because you’ll be able to use the UART 2 and 3 (but for the uart 0, you have to edit the bootloader command line, which may not be possible with this android image without recompiling).

To be able to open the serial port in a program not ran via adb (via the launcher for exemple), you may also need to add/change the permissions of the /dev/ttySx (0777), somewhere in an uevent*.d* file if the sources were available, but maybe there’s a file you can change somewhere to do the same thing, I don’t know.

Thank you for you help! Follow your step,i make a new img file,my GPS module is added to the uart2, i make a APP(write by myself),but i can’t accept the data. Could give me some advice?

By “can’t accept the data”, do you mean that you don’t receive anything when you should or that the data you get is wrong ? If it’s just garbled data, you may look into setting the right serial port configuration (speed and such) programmaticaly.

Did you :

  • set “used = 1” to the uart 2 / 3 in the sys_config.fex
  • If you don’t use the RTS or CTS line, you can set the uart_type to “2”.
  • Can you open /dev/ttyS2 via adb shell and does it output something ? (“adb shell cat /dev/ttyS2”)
  • You have to remove the GPIO pin “device” corresponding to every pin used by a peripheral (so for UART 2, remove the line using PB00 and PB01 in the “gpio configuration” section.

And as I said in the last message regarding apps not ran with adb :

[…] To be able to open the serial port in a program not ran via adb (via the launcher for exemple), you may also need to add/change the permissions of the /dev/ttySx (0777), somewhere in an uevent*.d* file if the sources were available, but maybe there’s a file you can change somewhere to do the same thing, I don’t know.

HI … kailokyra

Nice Article… things looksgood… for uboot & fex

what about zimge & android file system… to complete " BananapiM3_LCD7.img"

please update…remining thing… Thanks in Advance

Hi,

I don’t really get what issue you’re having ? What’s zimge ?

The steps I described should work with any android image, as long as you change the paths in the steps to the ones that matches what you want to do.

Hi, I want to do the same thing and use serial port of my bpi-m64. is there an alternative way to do the steps that you mentioned in windows? can i do the same things for bpi-m64 at all?

Thanks

Hi,

I don’t know if the tools I listed exist on Windows (except imagerepacker, there’s one for sure), but you can use a virtual machine to install linux if you don’t want to install it on your computer :slight_smile: You may even be able to use linux on the bananapi to do it.

I’m pretty sure you can apply this procedure to the BPI-M64, you’ll probably have to change a path or two.

Best,

Hi,

Thanks for your help. I can not find any BSP repository for BPI-M64. there are some BSP provided by Allwinner in Pine64 Website but I’m not able to download them yet. If I can download them, can I use them for BPI-M64 or they are costumized just for Pine64?

Is it necessary to build uboot at all? what does it do? can i do this without having BPI-M64 BSP?

any help would be appreciated

Thank you

I don’t think you can use the BSP for the Pine64 (well, you could maybe with some modifications in the device tree source (the dts file describing all the peripherals and values, but I can’t help with that).

Ask @sinovoip for the BSP if it exists for the BPI-M64

For uboot, it’s the bootloader. It should be in the bsp. I don’t know if you can do without, by just reusing the previous one, I haven’t tested.

Yes, there is none. The Banana guys simply used everything from Pine64 in the beginning (so neither Wi-Fi worked nor eMMC and a lot of other stuff on BPI_M64 in the beginning) and then users jumped in and fixed their stuff. So there’s still nothing useable from BPI manufacturer and your only hope is: https://github.com/avafinger/bpi-m64-firmware

To adjust stuff as UART you need dtc tool to convert .dtb to .dts and back (follow instructions for Pine64 since it’s the same)

apt-get install device-tree-compiler

Instructions on how to write

thank you very much kailokyra for your help in this post. I also want to try activating UART2 for GPS. Unfortunately, I can not continue because I do not understand the way.

I downloaded the Android 5.1.1 image and used it on SD card and eMMC. I have unpacked this image with “imgRePacker_206” and edited the file “sys_config.fex”.

When editing I wondered which pins of the 40 pin GPIO are the pins for UART2 or to which pins lead PB00 and PB01? I can not read that from the above linked images. Additionally, I wonder if RX must be set as input and TX as output.

[UART2]
uart_used = 1
uart_port = 2
uart_type = 2
uart_tx = port: PB00 <2> <1> <default> <default>
uart_rx = port: PB01 <2> <1> <default> <default>
uart_regulator = "vcc-io"

Is it correct that way?

and how do I rebuild the image? I did not understand that yet. Why flash with LiveSuite and not with PhoenixSuite?

P.S. I think “[gps_para]” is for “[rf_para] modul_num = 7”.

Hey guys, I am trying to build the u_boot from here https://github.com/BPI-SINOVOIP/BPI-M2Z-bsp for BPI-P2Z with kernel 3.4.

I have combined information how to build it from this page and two aditional sources:

https://linux-sunxi.org/H3_Manual_build_howto#Getting_a_cross_toolchain

https://codearetoy.wordpress.com/2016/01/12/orangepi-pc-android-display-on-dvi-monitor/

The build actually succeed as here:

BPI-M2Z-720P configured. Now run `make`
This tool support following building mode(s):
--------------------------------------------------------------------------------
	1. Build all, uboot and kernel and pack to download images.
	2. Build uboot only.
	3. Build kernel only.
	4. kernel configure.
	5. Pack the builds to target download image, this step must execute after u-boot,
	   kernel and rootfs build out
	6. update files for SD
	7. Clean all build.
--------------------------------------------------------------------------------
Please choose a mode(1-7): 2

 Now building...

./build_uboot.sh
MODE=legacy
make[1]: Entering directory '/home/ladik/Desktop/BPI/BPI-M2Z-bsp/u-boot-sunxi'
make[2]: Entering directory '/home/ladik/Desktop/BPI/BPI-M2Z-bsp/u-boot-sunxi/out/bpi-m2z-legacy'
  HOSTCC  scripts/basic/fixdep
  GEN     ./Makefile
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
arch/../configs/BPI-Sinovoip_BPI_M2_Zero_defconfig:21:warning: override: reassigning to symbol OLD_SUNXI_KERNEL_COMPAT
#
# configuration written to .config
#
make[2]: Leaving directory '/home/ladik/Desktop/BPI/BPI-M2Z-bsp/u-boot-sunxi/out/bpi-m2z-legacy'
make[1]: Leaving directory '/home/ladik/Desktop/BPI/BPI-M2Z-bsp/u-boot-sunxi'
make[1]: Entering directory '/home/ladik/Desktop/BPI/BPI-M2Z-bsp/u-boot-sunxi'
make[2]: Entering directory '/home/ladik/Desktop/BPI/BPI-M2Z-bsp/u-boot-sunxi/out/bpi-m2z-legacy'
  GEN     ./Makefile
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  UPD     include/config.h
  GEN     include/autoconf.mk.dep
  CFG     u-boot.cfg
  CFG     spl/u-boot.cfg
  GEN     include/autoconf.mk
  GEN     spl/include/autoconf.mk
  CHK     include/config/uboot.release
  CHK     include/generated/timestamp_autogenerated.h
  GEN     ./Makefile
  UPD     include/generated/timestamp_autogenerated.h
  UPD     include/config/uboot.release
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/dtc.o
  Using /home/ladik/Desktop/BPI/BPI-M2Z-bsp/u-boot-sunxi as source for U-Boot
  CHK     include/generated/version_autogenerated.h
  UPD     include/generated/version_autogenerated.h
  CC      lib/asm-offsets.s
  HOSTCC  scripts/dtc/srcpos.o
  CC      arch/arm/lib/asm-offsets.s
  HOSTCC  scripts/dtc/checks.o
  CHK     include/generated/generic-asm-offsets.h
  UPD     include/generated/generic-asm-offsets.h
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  HOSTCC  scripts/dtc/util.o
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  LDS     u-boot.lds
  CHK     include/config.h
  CFG     u-boot.cfg
  HOSTLD  scripts/dtc/dtc
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/img2srec
  HOSTCC  tools/os_support.o
  WRAP    tools/lib/crc8.c
  WRAP    tools/lib/crc32.c
  HOSTCC  tools/aisimage.o
  HOSTCC  tools/gen_ethaddr_crc.o
  HOSTCC  tools/atmelimage.o
  HOSTCC  tools/gen_eth_addr
  WRAP    tools/common/bootm.c
  HOSTCC  tools/default_image.o
  WRAP    tools/lib/fdtdec_common.c
  WRAP    tools/lib/fdtdec.c
  HOSTCC  tools/fit_common.o
  HOSTCC  tools/fit_image.o
  WRAP    tools/common/image-fit.c
  HOSTCC  tools/image-host.o
  WRAP    tools/common/image.c
  HOSTCC  tools/imagetool.o
  HOSTCC  tools/imximage.o
  HOSTCC  tools/kwbimage.o
  WRAP    tools/lib/md5.c
  HOSTCC  tools/lpc32xximage.o
  HOSTCC  tools/mxsimage.o
  HOSTCC  tools/omapimage.o
  HOSTCC  tools/pblimage.o
  HOSTCC  tools/pbl_crc32.o
  HOSTCC  tools/vybridimage.o
  WRAP    tools/lib/rc4.c
  HOSTCC  tools/rkcommon.o
  HOSTCC  tools/rkimage.o
  HOSTCC  tools/rksd.o
  HOSTCC  tools/rkspi.o
  HOSTCC  tools/socfpgaimage.o
  WRAP    tools/lib/sha1.c
  WRAP    tools/lib/sha256.c
  WRAP    tools/common/hash.c
  HOSTCC  tools/ublimage.o
  HOSTCC  tools/zynqimage.o
  HOSTCC  tools/zynqmpimage.o
  WRAP    tools/lib/libfdt/fdt.c
  WRAP    tools/lib/libfdt/fdt_ro.c
  WRAP    tools/lib/libfdt/fdt_wip.c
  WRAP    tools/lib/libfdt/fdt_sw.c
  WRAP    tools/lib/libfdt/fdt_rw.c
  WRAP    tools/lib/libfdt/fdt_strerror.c
  WRAP    tools/lib/libfdt/fdt_empty_tree.c
  WRAP    tools/lib/libfdt/fdt_addresses.c
  WRAP    tools/lib/libfdt/fdt_overlay.c
  WRAP    tools/lib/libfdt/fdt_region.c
  HOSTCC  tools/gpimage.o
  HOSTCC  tools/gpimage-common.o
  HOSTCC  tools/dumpimage.o
  HOSTCC  tools/mkimage.o
  HOSTCC  tools/mksunxiboot
  HOSTCC  tools/sunxi-spl-image-builder.o
  WRAP    tools/lib/bch.c
  HOSTCC  tools/proftool
  HOSTCC  tools/fdtgrep.o
  HOSTCC  tools/lib/crc8.o
  HOSTCC  tools/lib/crc32.o
  HOSTCC  tools/common/bootm.o
  HOSTCC  tools/lib/fdtdec_common.o
  HOSTCC  tools/lib/fdtdec.o
  HOSTCC  tools/common/image-fit.o
  HOSTCC  tools/common/image.o
  HOSTCC  tools/lib/md5.o
  HOSTCC  tools/lib/rc4.o
  HOSTCC  tools/lib/sha1.o
  HOSTCC  tools/lib/sha256.o
  HOSTCC  tools/common/hash.o
  HOSTCC  tools/lib/libfdt/fdt.o
  HOSTCC  tools/lib/libfdt/fdt_ro.o
  HOSTCC  tools/lib/libfdt/fdt_wip.o
  HOSTCC  tools/lib/libfdt/fdt_sw.o
  HOSTCC  tools/lib/libfdt/fdt_rw.o
  HOSTCC  tools/lib/libfdt/fdt_strerror.o
  HOSTCC  tools/lib/libfdt/fdt_empty_tree.o
  HOSTCC  tools/lib/libfdt/fdt_addresses.o
  HOSTCC  tools/lib/libfdt/fdt_overlay.o
  HOSTCC  tools/lib/libfdt/fdt_region.o
  HOSTCC  tools/lib/bch.o
  HOSTLD  tools/gen_ethaddr_crc
  HOSTLD  tools/mkenvimage
  HOSTLD  tools/fdtgrep
  HOSTLD  tools/dumpimage
  HOSTLD  tools/mkimage
  HOSTLD  tools/sunxi-spl-image-builder
  LD      arch/arm/cpu/built-in.o
  CC      board/sunxi/board.o
  CC      arch/arm/mach-sunxi/board.o
  CC      arch/arm/cpu/armv7/cache_v7.o
  CC      disk/part.o
  AS      arch/arm/lib/vectors.o
  AS      arch/arm/lib/crt0.o
  AS      arch/arm/lib/relocate.o
  CC      cmd/boot.o
  CC      arch/arm/lib/bootm-fdt.o
  CC      common/init/board_init.o
  LD      drivers/adc/built-in.o
  AS      arch/arm/cpu/armv7/cache_v7_asm.o
  CC      arch/arm/mach-sunxi/clock.o
  LD      drivers/ata/built-in.o
  CC      arch/arm/cpu/armv7/cpu.o
  CC      cmd/bootm.o
  CC      drivers/block/blk_legacy.o
  LD      common/init/built-in.o
  CC      arch/arm/lib/bootm.o
  CC      common/main.o
  CC      arch/arm/mach-sunxi/cpu_info.o
  CC      arch/arm/cpu/armv7/cp15.o
  LD      board/sunxi/built-in.o
  CC      common/exports.o
  LD      drivers/dma/built-in.o
  CC      disk/part_dos.o
  CC      drivers/gpio/gpio-uclass.o
  CC      arch/arm/cpu/armv7/syslib.o
  CC      arch/arm/mach-sunxi/dram_helpers.o
  CC      cmd/help.o
  LD      drivers/block/built-in.o
  CC      common/hash.o
  CC      arch/arm/lib/zimage.o
  CC      drivers/core/device.o
  AS      arch/arm/cpu/armv7/lowlevel_init.o
  CC      arch/arm/mach-sunxi/pinmux.o
  CC      cmd/version.o
  AS      arch/arm/cpu/armv7/nonsec_virt.o
  CC      arch/arm/cpu/armv7/virt-v7.o
  AS      arch/arm/lib/memset.o
  AS      arch/arm/lib/memcpy.o
  CC      cmd/blk_common.o
  CC      arch/arm/lib/sections.o
  CC      common/cli_hush.o
  CC      disk/part_iso.o
  CC      arch/arm/lib/stack.o
  CC      arch/arm/mach-sunxi/usb_phy.o
  CC      arch/arm/cpu/armv7/virt-dt.o
  CC      arch/arm/lib/interrupts.o
  CC      cmd/source.o
  AS      arch/arm/cpu/armv7/psci.o
  CC      arch/arm/cpu/armv7/psci-common.o
  CC      disk/part_efi.o
  CC      cmd/bdinfo.o
  CC      arch/arm/lib/reset.o
  CC      arch/arm/mach-sunxi/prcm.o
  CC      arch/arm/cpu/armv7/sunxi/timer.o
  CC      drivers/gpio/sunxi_gpio.o
  CC      drivers/core/fdtaddr.o
  CC      cmd/bootefi.o
  CC      arch/arm/lib/cache.o
  CC      arch/arm/mach-sunxi/rsb.o
  CC      arch/arm/cpu/armv7/sunxi/tzpc.o
  CC      arch/arm/cpu/armv7/sunxi/psci.o
  CC      arch/arm/lib/cache-cp15.o
  LD      drivers/gpio/built-in.o
  CC      drivers/core/lists.o
  CC      arch/arm/mach-sunxi/clock_sun6i.o
  CC      drivers/i2c/i2c-uclass.o
  LD      arch/arm/cpu/armv7/sunxi/built-in.o
  AS      arch/arm/cpu/armv7/start.o
  CC      arch/arm/lib/psci-dt.o
  CC      cmd/bootz.o
  LD      arch/arm/cpu/armv7/built-in.o
  LD      drivers/mtd/built-in.o
  LD      arch/arm/mach-sunxi/built-in.o
  LD      drivers/mtd/onenand/built-in.o
  CC      drivers/core/root.o
  LD      drivers/mtd/spi/built-in.o
  CC      drivers/net/sun8i_emac.o
  CC      drivers/net/phy/phy.o
  CC      cmd/console.o
  AS      arch/arm/lib/ashldi3.o
  AS      arch/arm/lib/ashrdi3.o
  CC      arch/arm/lib/div0.o
  CC      cmd/echo.o
  AS      arch/arm/lib/div64.o
  LD      drivers/i2c/built-in.o
  CC      common/autoboot.o
  LD      drivers/pci/built-in.o
  AS      arch/arm/lib/lib1funcs.o
  AS      arch/arm/lib/lshrdi3.o
  LD      drivers/power/built-in.o
  AS      arch/arm/lib/muldi3.o
  LD      drivers/power/battery/built-in.o
  CC      drivers/core/uclass.o
  LD      disk/built-in.o
  CC      cmd/elf.o
  LD      drivers/power/domain/built-in.o
  AS      arch/arm/lib/uldivmod.o
  CC      common/board_f.o
  LD      drivers/power/fuel_gauge/built-in.o
  CC      arch/arm/lib/eabi_compat.o
  LD      drivers/power/mfd/built-in.o
  LD      drivers/power/pmic/built-in.o
  CC      common/board_r.o
  LD      drivers/power/regulator/built-in.o
  AS      arch/arm/lib/crt0_arm_efi.o
  CC      drivers/serial/serial-uclass.o
  CC      arch/arm/lib/reloc_arm_efi.o
  LD      drivers/net/built-in.o
  CC      drivers/spi/spi.o
  LD      arch/arm/lib/built-in.o
  AR      arch/arm/lib/lib.a
  CC      cmd/exit.o
  CC      drivers/usb/common/common.o
  LD      drivers/net/phy/built-in.o
  LD      drivers/usb/dwc3/built-in.o
  CC      common/board_info.o
  LD      drivers/usb/emul/built-in.o
  LD      drivers/spi/built-in.o
  CC      drivers/serial/ns16550.o
  CC      cmd/ext4.o
  LD      drivers/usb/eth/built-in.o
  CC      common/bootm.o
  LD      drivers/usb/common/built-in.o
  CC      drivers/usb/gadget/epautoconf.o
  LD      drivers/usb/gadget/udc/built-in.o
  CC      cmd/ext2.o
  CC      common/bootm_os.o
  CC      drivers/usb/host/usb-uclass.o
  CC      drivers/core/util.o
  CC      cmd/fat.o
  CC      cmd/fdt.o
  CC      drivers/usb/gadget/config.o
  LD      drivers/serial/built-in.o
  CC      drivers/core/device-remove.o
  CC      cmd/fs.o
  CC      common/fdt_support.o
  CC      drivers/usb/gadget/usbstring.o
  CC      common/miiphyutil.o
  LD      drivers/usb/musb-new/built-in.o
  CC      cmd/gpio.o
  LD      drivers/usb/musb/built-in.o
  LD      drivers/usb/phy/built-in.o
  LD      drivers/usb/ulpi/built-in.o
  CC      drivers/core/simple-bus.o
  LD      drivers/usb/gadget/built-in.o
  CC      env/common.o
  CC      fs/fs.o
  CC      drivers/usb/host/ohci-hcd.o
  CC      drivers/core/dump.o
  CC      cmd/itest.o
  CC      env/env.o
  CC      common/usb.o
  CC      cmd/load.o
  CC      cmd/mem.o
  CC      drivers/core/of_extra.o
  CC      env/attr.o
  CC      drivers/core/ofnode.o
  CC      env/callback.o
  CC      cmd/mii.o
  CC      fs/ext4/ext4fs.o
  CC      common/usb_hub.o
  CC      env/flags.o
  CC      cmd/mdio.o
  CC      common/usb_storage.o
  CC      drivers/core/read_extra.o
  CC      cmd/misc.o
  CC      cmd/mmc.o
  CC      env/mmc.o
  CC      fs/ext4/ext4_common.o
  LD      drivers/core/built-in.o
  CC      drivers/usb/host/ohci-sunxi.o
  CC      cmd/net.o
  CC      drivers/crypto/fsl/sec.o
  CC      common/iomux.o
  LD      drivers/crypto/fsl/built-in.o
  LD      env/built-in.o
  LD      drivers/crypto/rsa_mod_exp/built-in.o
  LD      drivers/crypto/built-in.o
  LD      drivers/dfu/built-in.o
  LD      drivers/firmware/built-in.o
  CC      cmd/part.o
  CC      drivers/usb/host/ehci-hcd.o
  CC      drivers/input/keyboard-uclass.o
  CC      common/edid.o
  CC      lib/efi_loader/efi_image_loader.o
  CC      drivers/input/input.o
  CC      cmd/pcmcia.o
  CC      cmd/pxe.o
  CC      cmd/setexpr.o
  CC      fs/ext4/dev.o
  CC      lib/efi_loader/efi_boottime.o
  CC      common/splash.o
  LD      fs/ext4/built-in.o
  CC      common/menu.o
  CC      fs/fat/fat_write.o
  CC      common/usb_kbd.o
  CC      cmd/test.o
  CC      drivers/input/key_matrix.o
  CC      common/cli_readline.o
  CC      cmd/usb.o
  LD      drivers/input/built-in.o
  LD      drivers/mailbox/built-in.o
  LD      drivers/memory/built-in.o
  CC      drivers/usb/host/ehci-sunxi.o
  LD      drivers/misc/built-in.o
  CC      common/cli_simple.o
  CC      drivers/mmc/mmc.o
  CC      cmd/disk.o
  LD      drivers/usb/host/built-in.o
  CC      net/checksum.o
  CC      common/console.o
  CC      cmd/ximg.o
  CC      common/dlmalloc.o
  CC      cmd/gpt.o
  CC      net/arp.o
  CC      cmd/nvedit.o
  CC      lib/efi_loader/efi_runtime.o
  CC      net/bootp.o
  CC      lib/efi_loader/efi_console.o
  CC      common/malloc_simple.o
  CC      common/image.o
  CC      common/image-fdt.o
  CC      common/memsize.o
  LD      cmd/built-in.o
  CC      net/eth-uclass.o
  LD      test/built-in.o
  CC      common/stdio.o
  CC      test/dm/cmd_dm.o
  LD      fs/fat/built-in.o
  CC      lib/efi_loader/efi_memory.o
  CC      fs/fs_internal.o
  CC      drivers/mmc/mmc_legacy.o
  CC      common/cli.o
  LD      test/dm/built-in.o
  CC      common/command.o
  LD      fs/built-in.o
  CC      common/s_record.o
  CC      drivers/mmc/mmc_write.o
  CC      common/xyzModem.o
  CC      drivers/mmc/sunxi_mmc.o
  CC      lib/efi_loader/efi_device_path_to_text.o
  CC      net/eth_common.o
  CC      lib/efi_loader/efi_device_path.o
  LD      drivers/pcmcia/built-in.o
  LD      drivers/phy/marvell/built-in.o
  LD      drivers/pwm/built-in.o
  LD      drivers/reset/built-in.o
  CC      drivers/rtc/date.o
  CC      lib/efi_loader/efi_file.o
  LD      drivers/rtc/built-in.o
  LD      drivers/scsi/built-in.o
  CC      lib/efi_loader/efi_variable.o
  CC      net/net.o
  LD      common/built-in.o
  LD      drivers/soc/built-in.o
  CC      lib/efi_loader/efi_bootmgr.o
  LD      drivers/sound/built-in.o
  LD      drivers/mmc/built-in.o
  LD      drivers/spmi/built-in.o
  CC      net/nfs.o
  LD      drivers/sysreset/built-in.o
  LD      drivers/thermal/built-in.o
  LD      drivers/tpm/built-in.o
  LD      drivers/watchdog/built-in.o
  CC      lib/efi_loader/efi_gop.o
  CC      drivers/video/display-uclass.o
  CC      lib/efi_loader/efi_disk.o
  CC      lib/efi_loader/efi_net.o
  CC      drivers/video/backlight-uclass.o
  CC      lib/efi_loader/efi_smbios.o
  CC      lib/efi_loader/helloworld.o
  CC      drivers/video/panel-uclass.o
  CC      drivers/video/simple_panel.o
  LD      lib/efi_selftest/built-in.o
  LD      lib/efi_loader/helloworld_efi.so
  OBJCOPY lib/efi_loader/helloworld.efi
  CC      drivers/video/video-uclass.o
  CC      drivers/video/vidconsole-uclass.o
  CC      lib/libfdt/fdt.o
  CC      lib/libfdt/fdt_ro.o
  LD      lib/efi_loader/built-in.o
rm lib/efi_loader/helloworld_efi.so lib/efi_loader/helloworld.o
  CC      lib/zlib/zlib.o
  CC      net/ping.o
  CC      drivers/video/video_bmp.o
  CC      net/tftp.o
  CC      lib/libfdt/fdt_rw.o
  CC      drivers/video/console_normal.o
  CC      lib/libfdt/fdt_strerror.o
  CC      lib/libfdt/fdt_sw.o
  LD      drivers/video/bridge/built-in.o
  CC      lib/charset.o
  CC      drivers/video/sunxi/sunxi_de2.o
  LD      net/built-in.o
  CC      drivers/video/sunxi/sunxi_dw_hdmi.o
  CC      lib/crc7.o
  CC      lib/libfdt/fdt_wip.o
  CC      lib/crc8.o
  CC      lib/crc16.o
  CC      lib/smbios.o
  CC      lib/initcall.o
  CC      lib/libfdt/fdt_empty_tree.o
  CC      drivers/video/sunxi/simplefb_common.o
  CC      lib/libfdt/fdt_addresses.o
  CC      lib/lmb.o
  CC      lib/libfdt/fdt_region.o
  CC      lib/ldiv.o
  CC      drivers/video/sunxi/lcdc.o
  CC      lib/net_utils.o
  CC      lib/qsort.o
  CC      drivers/video/sunxi/../dw_hdmi.o
  CC      lib/rc4.o
  CC      lib/list_sort.o
  CC      lib/gunzip.o
  CC      lib/fdtdec_common.o
  CC      lib/fdtdec.o
  CC      drivers/video/sunxi/sunxi_lcd.o
  LD      lib/libfdt/built-in.o
  CC      lib/hashtable.o
  CC      lib/errno.o
  CC      lib/display_options.o
  CC      lib/crc32.o
  CC      lib/ctype.o
  CC      lib/div64.o
  CC      lib/hang.o
  LD      drivers/video/sunxi/built-in.o
  LD      drivers/video/built-in.o
  LD      drivers/built-in.o
  CC      lib/linux_compat.o
  CC      lib/linux_string.o
  CC      lib/membuff.o
  CC      lib/slre.o
  CC      lib/string.o
  LD      lib/zlib/built-in.o
  CC      lib/tables_csum.o
  CC      lib/time.o
  CC      lib/uuid.o
  CC      lib/rand.o
  CC      lib/vsprintf.o
  CC      lib/panic.o
  CC      lib/strto.o
  CC      lib/strmhz.o
  LD      lib/built-in.o
  CC      examples/standalone/hello_world.o
  CC      examples/standalone/stubs.o
  LD      examples/standalone/libstubs.o
  LD      examples/standalone/hello_world
  OBJCOPY examples/standalone/hello_world.bin
  OBJCOPY examples/standalone/hello_world.srec
  LD      u-boot
  OBJCOPY u-boot-nodtb.bin
  OBJCOPY u-boot.srec
  SYM     u-boot.sym
  DTC     arch/arm/dts/sun8i-h3-bananapi-m2-plus.dtb
  DTC     arch/arm/dts/sun8i-h3-bananapi-m2-zero.dtb
  DTC     arch/arm/dts/sun8i-h2-plus-orangepi-zero.dtb
  DTC     arch/arm/dts/sun8i-h3-orangepi-2.dtb
  DTC     arch/arm/dts/sun8i-h3-orangepi-lite.dtb
  DTC     arch/arm/dts/sun8i-h3-orangepi-one.dtb
  DTC     arch/arm/dts/sun8i-h3-orangepi-pc.dtb
  DTC     arch/arm/dts/sun8i-h3-orangepi-pc-plus.dtb
  DTC     arch/arm/dts/sun8i-h3-orangepi-plus.dtb
  DTC     arch/arm/dts/sun8i-h3-orangepi-plus2e.dtb
  DTC     arch/arm/dts/sun8i-h3-nanopi-m1.dtb
  DTC     arch/arm/dts/sun8i-h3-nanopi-m1-plus.dtb
  DTC     arch/arm/dts/sun8i-h3-nanopi-neo.dtb
  DTC     arch/arm/dts/sun8i-h3-nanopi-neo-air.dtb
make[4]: 'arch/arm/dts/sun8i-h3-bananapi-m2-zero.dtb' is up to date.
  SHIPPED dts/dt.dtb
  CAT     u-boot-dtb.bin
  COPY    u-boot.dtb
  COPY    u-boot.bin
  MKIMAGE u-boot.img
  MKIMAGE u-boot-dtb.img
  LD      spl/arch/arm/cpu/built-in.o
  CC      spl/common/init/board_init.o
  CC      spl/common/spl/spl.o
  CC      spl/board/sunxi/board.o
  CC      spl/cmd/nvedit.o
  CC      spl/common/console.o
  CC      spl/arch/arm/mach-sunxi/board.o
  CC      spl/arch/arm/cpu/armv7/cache_v7.o
  AS      spl/arch/arm/lib/vectors.o
  AS      spl/arch/arm/lib/crt0.o
  CC      spl/arch/arm/lib/spl.o
  LD      spl/common/init/built-in.o
  CC      spl/env/common.o
  AS      spl/arch/arm/cpu/armv7/cache_v7_asm.o
  CC      spl/arch/arm/cpu/armv7/cpu.o
  CC      spl/arch/arm/mach-sunxi/clock.o
  CC      spl/arch/arm/lib/zimage.o
  LD      spl/cmd/built-in.o
  CC      spl/env/env.o
  CC      spl/common/spl/spl_mmc.o
  CC      spl/arch/arm/lib/bootm-fdt.o
  CC      spl/arch/arm/cpu/armv7/cp15.o
  LD      spl/board/sunxi/built-in.o
  CC      spl/arch/arm/mach-sunxi/cpu_info.o
  CC      spl/lib/hashtable.o
  CC      spl/disk/part.o
  CC      spl/common/dlmalloc.o
  CC      spl/arch/arm/cpu/armv7/syslib.o
  AS      spl/arch/arm/lib/memset.o
  LD      spl/env/built-in.o
  CC      spl/arch/arm/mach-sunxi/dram_helpers.o
  AS      spl/arch/arm/lib/memcpy.o
  LD      spl/common/spl/built-in.o
  CC      spl/arch/arm/lib/sections.o
  LD      spl/dts/built-in.o
  CC      spl/drivers/block/blk_legacy.o
  CC      spl/fs/fs_internal.o
  AS      spl/arch/arm/cpu/armv7/lowlevel_init.o
  CC      spl/arch/arm/lib/stack.o
  AS      spl/arch/arm/cpu/armv7/nonsec_virt.o
  CC      spl/arch/arm/mach-sunxi/pinmux.o
  CC      spl/arch/arm/cpu/armv7/virt-v7.o
  CC      spl/arch/arm/lib/interrupts.o
  LD      spl/fs/built-in.o
  LDS     spl/u-boot-spl.lds
  LD      spl/disk/built-in.o
  CC      spl/arch/arm/lib/reset.o
  CC      spl/drivers/gpio/sunxi_gpio.o
  CC      spl/arch/arm/cpu/armv7/virt-dt.o
  CC      spl/arch/arm/mach-sunxi/usb_phy.o
  CC      spl/lib/errno.o
  LD      spl/drivers/block/built-in.o
  CC      spl/drivers/mmc/mmc.o
  CC      spl/lib/display_options.o
  CC      spl/arch/arm/lib/cache.o
  CC      spl/arch/arm/lib/cache-cp15.o
  AS      spl/arch/arm/cpu/armv7/psci.o
  CC      spl/arch/arm/cpu/armv7/psci-common.o
  LD      spl/drivers/gpio/built-in.o
  CC      spl/arch/arm/lib/psci-dt.o
  LD      spl/drivers/power/built-in.o
  CC      spl/common/malloc_simple.o
  LD      spl/drivers/power/pmic/built-in.o
  CC      spl/arch/arm/cpu/armv7/sunxi/timer.o
  LD      spl/drivers/power/regulator/built-in.o
  AS      spl/arch/arm/lib/ashldi3.o
  CC      spl/drivers/serial/serial.o
  AS      spl/arch/arm/lib/ashrdi3.o
  CC      spl/arch/arm/mach-sunxi/prcm.o
  CC      spl/arch/arm/lib/div0.o
  CC      spl/common/image.o
  AS      spl/arch/arm/lib/div64.o
  AS      spl/arch/arm/lib/lib1funcs.o
  AS      spl/arch/arm/lib/lshrdi3.o
  AS      spl/arch/arm/lib/muldi3.o
  CC      spl/arch/arm/cpu/armv7/sunxi/tzpc.o
  CC      spl/arch/arm/mach-sunxi/rsb.o
  CC      spl/lib/crc32.o
  AS      spl/arch/arm/lib/uldivmod.o
  CC      spl/arch/arm/lib/eabi_compat.o
  AS      spl/arch/arm/lib/crt0_arm_efi.o
  AS      spl/arch/arm/cpu/armv7/sunxi/fel_utils.o
  CC      spl/arch/arm/lib/reloc_arm_efi.o
  LD      spl/arch/arm/cpu/armv7/sunxi/built-in.o
  AS      spl/arch/arm/cpu/armv7/start.o
  CC      spl/drivers/serial/serial_ns16550.o
  LD      spl/arch/arm/cpu/armv7/built-in.o
  LD      spl/arch/arm/lib/built-in.o
  CC      spl/drivers/mmc/mmc_legacy.o
  AR      spl/arch/arm/lib/lib.a
  CC      spl/common/memsize.o
  CC      spl/drivers/mmc/sunxi_mmc.o
  CC      spl/arch/arm/mach-sunxi/clock_sun6i.o
  CC      spl/lib/ctype.o
  CC      spl/lib/div64.o
  CC      spl/common/stdio.o
  CC      spl/drivers/serial/ns16550.o
  CC      spl/common/cli.o
  CC      spl/arch/arm/mach-sunxi/dram_sunxi_dw.o
  CC      spl/common/command.o
  CC      spl/lib/hang.o
  CC      spl/common/s_record.o
  LD      spl/drivers/serial/built-in.o
  CC      spl/lib/linux_compat.o
  CC      spl/common/xyzModem.o
  CC      spl/lib/linux_string.o
  CC      spl/lib/membuff.o
  CC      spl/lib/slre.o
  CC      spl/lib/string.o
  CC      spl/lib/tables_csum.o
  CC      spl/arch/arm/mach-sunxi/dram_timings/ddr3_1333.o
  LD      spl/drivers/mmc/built-in.o
  LD      spl/drivers/built-in.o
  CC      spl/lib/time.o
  CC      spl/lib/uuid.o
  CC      spl/lib/rand.o
  LD      spl/arch/arm/mach-sunxi/dram_timings/built-in.o
  LD      spl/arch/arm/mach-sunxi/built-in.o
  CC      spl/lib/tiny-printf.o
  LD      spl/common/built-in.o
  CC      spl/lib/panic.o
  CC      spl/lib/strto.o
  LD      spl/lib/built-in.o
  LD      spl/u-boot-spl
  OBJCOPY spl/u-boot-spl-nodtb.bin
  COPY    spl/u-boot-spl.bin
  MKSUNXI spl/sunxi-spl.bin
  BINMAN  u-boot-sunxi-with-spl.bin
  CFGCHK  u-boot.cfg
make[2]: Leaving directory '/home/ladik/Desktop/BPI/BPI-M2Z-bsp/u-boot-sunxi/out/bpi-m2z-legacy'
make[1]: Leaving directory '/home/ladik/Desktop/BPI/BPI-M2Z-bsp/u-boot-sunxi'
bpi-m2z-legacy

Build success!

However once I am trying to update u_boot with sys_config.fex in binary form

Done this to get binary form of sys_config.fex:

$ unix2dos out/sys_config.fex
$ fex2bin out/sys_config.fex out/sys_config.bin

I am gettin bellow error

$ sunxi-pack/pctools/linux/mod_update/update_uboot' out/u-boot.fex out/sys_config.bin

uboot file Path=/home/ladik/Desktop/BPI/out/u-boot.fex
script file Path=/home/ladik/Desktop/BPI/out/sys_config.bin

update uboot error : uboot pre checksum error
update uboot error: update error

Any chance someone could help ? Thank you in advance.