マクロ自体は複雑。 エラー出るとデバッグは面倒。 dts/riscv/gigadevice/gd32vf103.dtsi から抜粋、編集 / { soc { usart0: serial@40013800 { compatible = "gd,gd32-usart"; reg = <0x40013800 0x400>; interrupts = <56 0>; interrupt-parent = <&eclic>; rcu-periph-clock = <0x60e>; status = “okay"; label = "UART_0"; }; usart1: serial@40004400 { compatible = "gd,gd32-usart"; … 生成された devicetree_unfixed.h #define DT_N_S_soc_S_serial_40013800_PATH "/soc/serial@40013800" #define DT_N_S_soc_S_serial_40013800_FULL_NAME "serial@40013800" #define DT_N_S_soc_S_serial_40013800_PARENT DT_N_S_soc #define DT_N_S_soc_S_serial_40013800_CHILD_IDX 3 … © 2023 Fujitsu Limited 21