2022-09-23 jetson(5.0.2) orin pps 时间同步

相关文档:

https://docs.nvidia.com/jetson/archives/r35.1/DeveloperGuide/text/SD/Kernel/KernelCustomization.html


第一步,首先要学习编译内核,参考文档入上所示。用它们的手动下载源码的方式Manually Downloading and Expanding Kernel Sources,否则自动编译的文件是没有的。

这个过程是:

删除

sudo rm -rf $JETPACK/kernel/Image

sudo rm -rf $JETPACK/kernel/dtb

编译

./nvbuild.sh -o $PWD/kernel_out

拷贝

cp $kernel_out/arch/arm64/boot/Image $JETPACK/kernel/

cp -r $kernel_out/arch/arm64/boot/dts/nvidia $JETPACK/kernel/dtb


编译前,需要修改三点:

1.

kernel/kernel-5.10/arch/arm64/configs/tegra_defconfig

CONFIG_PPS=y

CONFIG_PPS_DEBUG=y

CONFIG_PPS_CLIENT_KTIMER=y

CONFIG_PPS_CLIENT_GPIO=y


2. hardware/nvidia/platform/t23x/concord/kernel-dts/tegra234-p3701-0000-p3737-0000.dts

pps {

compatible = "pps-gpio";

assert-falling-edge;

gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Q, 6) GPIO_ACTIVE_LOW>;

status = "okay";

};

3.kernel/kernel-5.10/drivers/pps/clients/pps-gpio.c

ret = pps_gpio_setup(pdev);

if (ret)

return ret;//-EINVAL;

第三点不加就会找不到/dev/pps1


4. 可能用到的安装

sudo apt install wget lbzip2 build-essential bc zip libgmp-dev libmpfr-dev libmpc-dev vim-common

sudo apt-get install libncurses5-dev

sudo apt-get install -y pkg-config

sudo apt-get install libssl-dev

你可能感兴趣的:(2022-09-23 jetson(5.0.2) orin pps 时间同步)