Malheureusement, la carte vient sans horloge RTC (comme avec le raspberry PI), ce qui signifie qu'en l'absence de connectivité réseau, le système n'est pas à l'heure après un démarrage.
La solution ? Installer une horloge dédiée de type DS3231 sur les PINs I2C. Ces modules s'insère directement sur 5 broches du connecteurs GPIO. Ils sont disponibles sur ebay pour quelques euros avec la pile.
Si la configuration est plutôt simple avec un raspberry PI, la Tinker Board est un peu moins docile et nécessitera une re-compilation du noyaux pour inclure les drivers adéquats. Voici la marche à suivre (je suis reparti de ce post en japonais):
Installer les outils de compilation:
sudo apt update && sudo apt install -y git-core build-essential bc libssl-dev device-tree-compiler
Télécharger le code source du noyau (Adapter le "1.9" à la release correspondant à votre image.)
git clone --depth 10 -b 1.9 https://github.com/TinkerBoard/debian_kernel.git kernel cd kernel
Appliquer un patch pour la compilation avec le gcc de l'image:
cat <<EOF | patch -p1 diff --git a/drivers/media/i2c/soc_camera/rockchip/Makefile b/drivers/media/i2c/soc_camera/rockchip/Makefile index 7933bcd1..2486999a 100755 --- a/drivers/media/i2c/soc_camera/rockchip/Makefile +++ b/drivers/media/i2c/soc_camera/rockchip/Makefile @@ -1,2 +1,3 @@ obj-\$(CONFIG_VIDEO_OV8858) += ov_camera_module.o rk_camera_module.o ov8858_v4l2-i2c-subdev.o obj-\$(CONFIG_VIDEO_IMX219) += imx_camera_module.o rk_camera_module.o imx219_v4l2-i2c-subdev.o +ccflags-y += -Wno-misleading-indentation # GCC6 diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723bs/Makefile b/drivers/net/wireless/rockchip_wlan/rtl8723bs/Makefile index 40715655..bd33c700 100644 --- a/drivers/net/wireless/rockchip_wlan/rtl8723bs/Makefile +++ b/drivers/net/wireless/rockchip_wlan/rtl8723bs/Makefile @@ -16,6 +16,7 @@ EXTRA_CFLAGS += -Wno-unused #EXTRA_CFLAGS += -Wno-uninitialized #EXTRA_CFLAGS += -Wno-error=date-time # Fix compile error on gcc 4.9 and later +EXTRA_CFLAGS += -Wno-misleading-indentation # GCC6 EXTRA_CFLAGS += -I\$(src)/include EXTRA_CFLAGS += -I\$(src)/hal/phydm EOF
Initialiser la conf:
# .config make ARCH=arm miniarm-rk3288_defconfig
Modifier la conf pour inclure le driver de l'horloge (on retire aussi le driver de RK808. En fait il y a bien un RTC sur la carte, mais il n'est pas utilisable car sans batterie):
cat << EOF | patch -p 0 --- .config 2017-09-26 20:35:20.604920650 +0000 +++ .config 2017-10-02 19:05:46.160760468 +0000 @@ -3514,7 +3514,7 @@ # # CONFIG_RTC_DRV_ABB5ZES3 is not set # CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_DS1307 is not set +CONFIG_RTC_DRV_DS1307=y # CONFIG_RTC_DRV_DS1374 is not set # CONFIG_RTC_DRV_DS1672 is not set # CONFIG_RTC_DRV_DS3232 is not set @@ -3520,7 +3520,7 @@ # CONFIG_RTC_DRV_DS3232 is not set CONFIG_RTC_DRV_HYM8563=y # CONFIG_RTC_DRV_MAX6900 is not set -CONFIG_RTC_DRV_RK808=y +# CONFIG_RTC_DRV_RK808 is not set # CONFIG_RTC_DRV_RS5C372 is not set # CONFIG_RTC_DRV_ISL1208 is not set # CONFIG_RTC_DRV_ISL12022 is not set EOF
Compiler le noyau et les modules:
# zImage time make ARCH=arm -j6 zImage 2>&1 | tee 1.log #real 25m12.322s #user 78m3.870s #sys 4m43.920s # modules time make ARCH=arm -j6 modules 2>&1 | tee 2.log #real 1m35.393s #user 4m26.670s #sys 0m24.790s # dtbs time make ARCH=arm dtbs 2>&1 | tee 3.log #real 0m8.204s #user 0m3.110s #sys 0m1.100s
Patcher le "device tree" pour déclarer votre nouvelle horloge:
dtc -O dts -o custom.dts -b 0 arch/arm/boot/dts/rk3288-miniarm.dtb cat << EOF | patch -p0 -l --- custom.dts 2017-10-02 19:37:26.716337419 +0000 +++ custom.dts 2017-10-02 19:39:25.227666822 +0000 @@ -438,24 +438,31 @@ i2c@ff140000 { compatible = "rockchip,rk3288-i2c"; reg = <0xff140000 0x1000>; interrupts = <0x0 0x3e 0x4>; #address-cells = <0x1>; #size-cells = <0x0>; clock-names = "i2c"; clocks = <0x7 0x14d>; pinctrl-names = "default"; pinctrl-0 = <0x28>; status = "okay"; + rtc@68 { + compatible = "dallas,ds1307"; + #address-cells = <0x1>; + #size-cells = <0x0>; + reg = <0x68>; + }; + pcm5122@4c { #sound-dai-cells = <0x0>; compatible = "ti,pcm5122"; reg = <0x4c>; status = "disabled"; }; }; i2c@ff150000 { compatible = "rockchip,rk3288-i2c"; reg = <0xff150000 0x1000>; interrupts = <0x0 0x3f 0x4>; EOF dtc -O dtb -o arch/arm/boot/dts/rk3288-miniarm.dtb -b 0 custom.dts
Et enfin, installer le nouveau noyaux !
# Modules sudo make ARCH=arm modules_install # Backup: old kernel & dtb sudo mv -v /boot/zImage{,.bak} sudo mv -v /boot/rk3288-miniarm.dtb{,.bak} # Copy: new kernel & dtb sudo cp -v arch/arm/boot/{zImage,dts/rk3288-miniarm.dtb} /boot
Au prochain reboot, vous pourrez vérifier que la nouvelle horloge est bien détecté et utilisée:
dmesg | grep rtc [ 3.907713] rtc-ds1307 1-0068: rtc core: registered ds3231 as rtc0 [ 8.259803] rtc-ds1307 1-0068: setting system clock to 2017-10-03 20:08:58 UTC (1507061338)
dtc -O dts -o custom.dts -b 0 arch/arm/boot/dts/rk3288-miniarm.dtb
RépondreSupprimerfail
any error message ?
SupprimerError: arch/arm/boot/dts/rk3288-miniarm.dtb:1.1-2 syntax error
SupprimerFATAL ERROR: Unable to parse input tree
ok, before command
RépondreSupprimer"time make ARCH=arm dtbs 2>&1 | tee 3.log"
I manualy edited arch/arm/boot/dts/rk3288-miniarm.dts, added rtc@68 in i2c1 chapter (before pcm5122@4c) and then called "time make ARCH=arm dtbs 2>&1 | tee 3.log”
After this step, the i continued with "sudo make ARCH=arm modules_install” etc and it worked.
Thanks for your tutorial