@xiong.zhang, thanks for the infos.
I’m not familiar with repo so I downoaded all source.
After I try to make only the dtbo but the compilation finish with errors:
...
[ 4% 22/501] Yacc: dtc <= external/dtc/dtc-parser.y
external/dtc/dtc-parser.y: conflicts: 3 shift/reduce
[ 99% 499/501] Instaled out/target/product/kvim3/dt.img
FAILED: out/target/product/kvim3/dt.img
/bin/bash -c "(sed -i 's/^#include \\\"partition_.*/#include \\\"partition_mbox_normal_P_64.dtsi\\\"/' common/arch/arm64/boot/dts/amlogic//kvim3.dts; sed -i 's/^#include \\\"firmware_.*/#include \\\"firmware_system.dtsi\\\"/' common/arch/arm64/boot/dts/amlogic//partition_mbox_normal_P_64.dtsi; if [ -f \"common/arch/arm64/boot/dts/amlogic//kvim3.dtd\" ]; then make -j4 -C common O=../out/target/product/kvim3/obj/KERNEL_OBJ ARCH=arm64 CROSS_COMPILE=/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- kvim3.dtd; fi; make -j4 -C common O=../out/target/product/kvim3/obj/KERNEL_OBJ ARCH=arm64 CROSS_COMPILE=/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- kvim3.dtb ) && (cp device/khadas/common/common_partition.xml out/target/product/kvim3/emmc_burn.xml ) && (./device/khadas/common/dtsi2xml.sh common/arch/arm64/boot/dts/amlogic//partition_mbox_normal_P_64.dtsi out/target/product/kvim3/emmc_burn.xml ) && (cp -f out/target/product/kvim3/obj/KERNEL_OBJ/arch/arm64/boot/dts/amlogic/kvim3.dtb out/target/product/kvim3/dt.img ) && (if [ -n \"\$(find out/target/product/kvim3/dt.img -size +200k)\" ]; then echo \"out/target/product/kvim3/dt.img > 200k will be gziped\"; mv out/target/product/kvim3/dt.img out/target/product/kvim3/dt.img.orig && out/host/linux-x86/bin/minigzip -c out/target/product/kvim3/dt.img.orig > out/target/product/kvim3/dt.img; fi )"
make: Entering directory '/home/user/.local/src/KHADAS_VIM3_ANDROID/common'
make[1]: Entering directory '/home/user/.local/src/KHADAS_VIM3_ANDROID/out/target/product/kvim3/obj/KERNEL_OBJ'
GEN ./Makefile
HOSTCC scripts/basic/fixdep
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
scripts/kconfig/conf --silentoldconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[3]: *** [/home/user/.local/src/KHADAS_VIM3_ANDROID/common/scripts/kconfig/Makefile:39: silentoldconfig] Error 1
make[2]: *** [/home/user/.local/src/KHADAS_VIM3_ANDROID/common/Makefile:556: silentoldconfig] Error 2
make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'scripts'. Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/user/.local/src/KHADAS_VIM3_ANDROID/out/target/product/kvim3/obj/KERNEL_OBJ'
make: *** [Makefile:152: sub-make] Error 2
make: Leaving directory '/home/user/.local/src/KHADAS_VIM3_ANDROID/common'
ninja: build stopped: subcommand failed.
17:46:11 ninja failed with: exit status 1
#### failed to build some targets (01:14 (mm:ss)) ####
So I try to compile first all with command
make -j`nproc` otapackage
The make command made errors again on multiple definition of `yylloc’ but I founded how to fix it.
After if I run again make dtboimage
and the command completed without error.
I saw that the make create two files:
But now I’m little confused about the dtbo and I need some help.
From many forum, about custom IR remote commander, all peoples said that is needed to modify the file _ /common/arch/arm64/boot/dts/amlogic/mesongxl.dtsi.
These are my custom parameters added on the file:
custom_maps:custom_maps {
- mapnum = <3>;
+ mapnum = <4>;
map0 = <&map_0>;
map1 = <&map_1>;
map2 = <&map_2>;
+ map3 = <&map_3>;
map_0: map_0{
mapname = "amlogic-remote-1";
customcode = <0xfb04>;
@@ -XXX,X +XXX,XX @@
REMOTE_KEY(0x9a,120)
REMOTE_KEY(0xcd,121)>;
};
+ map_3: map_3{
+ mapname = "my-remote";
+ customcode = <0xcb04>;
+ release_delay = <80>;
+ size = <34>;
+ keymap = <REMOTE_KEY(0x41, KEY_1)
+ REMOTE_KEY(0x03, KEY_2)
+ REMOTE_KEY(0x42, KEY_3)
+ REMOTE_KEY(0x45, KEY_4)
+ REMOTE_KEY(0x07, KEY_5)
+ REMOTE_KEY(0x46, KEY_6)
+ REMOTE_KEY(0x55, KEY_7)
+ REMOTE_KEY(0x17, KEY_8)
+ REMOTE_KEY(0x56, KEY_9)
+ REMOTE_KEY(0x1B, KEY_0)
+ REMOTE_KEY(0x52, KEY_VOLUMEDOWN)
+ REMOTE_KEY(0x4e, KEY_VOLUMEUP)
+ REMOTE_KEY(0x09, KEY_MENU)
+ REMOTE_KEY(0x01, KEY_RIGHT)
+ REMOTE_KEY(0x43, KEY_LEFT)
+ REMOTE_KEY(0x06, KEY_UP)
+ REMOTE_KEY(0x0a, KEY_DOWN)
+ REMOTE_KEY(0x02, KEY_ENTER)
+ REMOTE_KEY(0x51, KEY_MUTE)
+ REMOTE_KEY(0x47, KEY_BACK)
+ REMOTE_KEY(0x4b, KEY_INFO)
+ REMOTE_KEY(0x4a, KEY_POWER)
+ REMOTE_KEY(0x12, KEY_PREVIOUSSONG)
+ REMOTE_KEY(0x11, KEY_NEXTSONG)
+ REMOTE_KEY(0x0e, KEY_REWIND)
+ REMOTE_KEY(0x0d, KEY_FASTFORWARD)
+ REMOTE_KEY(0x50, KEY_PLAYPAUSE)
+ REMOTE_KEY(0x05, KEY_FN)
+ REMOTE_KEY(0x4c, KEY_FN_ESC)
+ REMOTE_KEY(0x5f, KEY_RED)
+ REMOTE_KEY(0x1e, KEY_GREEN)
+ REMOTE_KEY(0x5c, KEY_YELLOW)
+ REMOTE_KEY(0x1d, KEY_BLUE)
+ REMOTE_KEY(0x4c, KEY_SEARCH)>;
+ };
};
Anyway I notice that under dt.img and dtbo.img there isn’t my modifications (I inspected the files with hexdump).
From the inspection of the two files, I notice that dt.img is the file that contain the custom_maps but has only the map_0 with mapname=khadas-ir so I search the source file that contain that string and I find that is in these files:
- mesonsm1.dtsi
- mesong12b.dtsi
I modified the two file according my custom settings and then I recompile the dtbo image.
Now the dt.img contain my customization but now I don’t understand this:
Under android there is a block device mapped on the dtbo partition on the mmc but seem that contain the same data of dtbo.img, but from my inspection of the images created the dtbo.img not contain the custom_map of IR but is in the dt.img.
Anyway I tried to upload the dtbo.img, given that I’m not able to use adb to upload the image because I don’t have the board connected via usb but I have only serial access, I tried two method:
- 1 - directly via android using dd (
dd if=dtbo.img of=/dev/block/dtbo
) but after restart my IR commander still not working and I noticed that running these command on uboot the custom_maps are not changed:
kvim3#fdt addr ${dtb_mem_addr}
kvim3#fdt print /custom_maps/map_0
map_0 {
mapname = "khadas-ir";
customcode = <0x0000ff00>;
release_delay = <0x00000050>;
fn_key_scancode = <0x0000005b>;
cursor_left_scancode = <0x0000000e>;
cursor_right_scancode = <0x0000001a>;
cursor_up_scancode = <0x00000003>;
cursor_down_scancode = <0x00000002>;
cursor_ok_scancode = <0x00000007>;
size = <0x0000000d>;
keymap = <0x00140074 0x0013008b 0x00030067 0x0002006c 0x000e0069 0x001a006a 0x000700e8 0x00580072 0x005c003f 0x005b003f 0x000b0073 0x0001009e 0x00480066>;
phandle = <0x00000046>;
};
- 2 - update the dtbo.img via uboot with
usb_upgrade dtbo dtbo.img
This method fails:
usb_update dtbo dtbo.img
usb_start_count 0
(Re)start USB...
...
fat]Filesize is 0x1b6B[0M]
[FAT_ERR]L1212,offset(0x0) + wantsz(0x2000) > filesize(0x1b6)
Fail to read file(dtbo.img), readSz=0
ERR(../drivers/usb/gadget/v2_burning/v2_usb_burn/optimus_usb_update.c)L99:Fail when parse file format
The above command work if I use the dt.img instead dtbo.img but the IR commander still don’t work and under uboot if I run the command fdt print ...
the parameters of custom_maps still have the factory values.
So I’m confused, I think I must update on the board the dt.img file but I don’t understand how.
thank you in advance for the support…