FAQ_MA35D1_Communicate with RTP by Buildroot

Post Reply
ytliu6
Posts: 62
Joined: 08 Nov 2022, 10:28

05 Dec 2022, 16:21

1. Configure Linux kernel

Code: Select all

~/MA35D1_Buildroot$ make linux-menuconfig 

Device Drivers --->
    Remoteproc drivers --->
        [*] Support for Remote Processor subsystem
        <*> MA35D1 remoteproc support

Device Drivers --->
    Rpmsg drivers --->
    -*- RPMSG device interface
    <*> MA35D1 Shared Memory Driver
2. Modify Linux device tree

Code: Select all

~/MA35D1_Buildroot/output/build/linux-custom/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi$ vi ma35d1.dtsi

rproc {
                compatible = "nuvoton, ma35d1-rproc";
                resets = <&reset MA35D1_RESET_CM4>;
                memory-region = <&rproc_buf>;
                status = "okay";
        };


rpmsg {
                compatible = "nuvoton,ma35d1-rpmsg";
                share-mem-addr = <0x2401ff00>;
                mboxes = <&wormhole 2>;
                tx-smem-size = <128>;
                rx-smem-size = <128>;
                status = "okay";
        };


hwsem: hwspinlock@40380000 {
                compatible = "nuvoton,ma35d1-hwsem";
                reg = <0x0 0x40380000 0x0 0x1000>;
                clocks = <&clk HWS_GATE>;
                clock-names = "hws_gate";
                nuvoton,sys = <&sys>;
                status = "okay";
        };
3. Recompile Linux kernel

Code: Select all

~/MA35D1_Buildroot$ make linux-rebuild
4. Compile rpmsg.c, and copy it to rootfs

Code: Select all

~/MA35D1_Buildroot$ source output/host/environment-setup
~/MA35D1_Buildroot$ $CC rpmsg.c -o rpmsg
~/MA35D1_Buildroot$ cp -rf rpmsg out/images/target
5. Copy Share_memory_demo.elf to rootfs

Code: Select all

~/MA35D1_Buildroot$ cp -rf out/images/RTP-BSP out/image/target
6. Repack Image

Code: Select all

~/Buildroot_MA35D1$ make
7. Program Image to target board

8. Test

Code: Select all

# echo -n path > /sys/module/firmware_class/parameters/path
# echo Share_memory_demo.elf > /sys/class/remoteproc/remoteproc0/firmware
# echo start > /sys/class/remoteproc/remoteproc0/state
# ./rpmsg &
#MA35D1 #M4 #RTP #Real Timer Processor

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests