9.100ASK_V853-PRO development board supports E907 small core development

0. Preface

​ The V853 chip of the 100ASK_V853-PRO development board integrates Arm Cortex-A7 and RISC-V E907 dual CPUs. Xuantie E907 is a fully comprehensive high-end MCU processor. It is compatible with the RV32IMAC instruction set, providing considerable integer performance improvements and energy-efficient floating-point performance. Key features of the E907 include: single and double precision floating-point units, and fast interrupt response. The figure below is the introduction of RISC-V E907 core.

insert image description here

This chapter mainly describes how to develop the E907 small core and communicate with the Arm A7 large core.

Pingtouge E907 official website: https://www.t-head.cn/product/E907?spm=a2ouz.12986968.0.0.7bfc2cbdcYnL2b

E907 chip resource download center: https://occ.t-head.cn/community/download?id=3916180248689188864

Allwinner E907 Development Guide: https://tina.100ask.net/SdkModule/Linux_E907_DevelopmentGuide-01/

V85x E907 small core development and use of Yuzuki: https://www.gloomyghost.com/live/20230215.aspx

1. Configure the E907 environment

E907_RTOS BSP package: https://github.com/YuzukiHD/Yuzukilizard/tree/master/Software/BSP/e907_rtos

E907 compilation toolchain: https://github.com/YuzukiHD/Yuzukilizard/releases/download/Compiler.0.0.1/riscv64-elf-x86_64-20201104.tar.gz

Thanks to Yuzuki's V851S warehouse for providing the E907_RTOS source code. Here I put the E907 development kit in the Baidu network disk for easy access. The link is:

Link: https://pan.baidu.com/s/1TX742vfEde9bMLd9IrwwqA?pwd=sp6a
Extraction code: sp6a

You can get it from the 09_E907 development kit in the V853 data CD of Baidu Netdiske907_rtos.tar.gz

1.1 Compile E907 source code

Place the downloaded E907 development kit in any directory, assuming it is in /home/book/workspacesthe directory

book@100ask:~/workspaces$ ls
e907_rtos.tar.gz   

Unzip the e907 source code package, enter tar -xzvf e907_rtos.tar.gz , for example:

book@100ask:~/workspaces$ tar -xzvf e907_rtos.tar.gz 
e907_rtos/
e907_rtos/README.md
e907_rtos/rtos/
e907_rtos/rtos/LICENSE
e907_rtos/rtos/toolchain/
e907_rtos/rtos/toolchain/riscv64-elf-x86_64-20201104/
e907_rtos/rtos/toolchain/riscv64-elf-x86_64-20201104/libexec/
e907_rtos/rtos/toolchain/riscv64-elf-x86_64-20201104/libexec/gcc/
...

After the decompression is complete, enter the e907 source code directory

book@100ask:~/workspaces$ cd e907_rtos/
book@100ask:~/workspaces/e907_rtos$ ls
README.md  rtos  rtos-hal

enter rtos/source/the directory

book@100ask:~/workspaces/e907_rtos$ cd rtos/source/
book@100ask:~/workspaces/e907_rtos/rtos/source$ ls
disfunc.sh  ekernel   envsetup.sh  Kbuild   Kconfig.melis     Makefile      modules.order  platform.txt  scripts
drivers     emodules  include      Kconfig  Kconfig.platform  melis-env.sh  out            projects      tools

Configure the compilation environment variables, entersource melis-env.sh

book@100ask:~/workspaces/e907_rtos/rtos/source$ source melis-env.sh

Enter lunchthe selected corresponding development board

book@100ask:~/workspaces/e907_rtos/rtos/source$ lunch

You're building on Linux 100ask 5.4.0-148-generic #165~18.04.1-Ubuntu SMP Thu Apr 20 01:14:06 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Lunch menu... pick a combo:
The supported board:
    1. v851-e907-lizard
    2. v851-e907-lizard-tinymaix
    3. v853-e907-100ask
    4. v853-e907-100ask-tinymaix
What is your choice? 

Now enter 3 and press Enter. Select v853-e907-100askthe scheme, after the selection is completed, it will be as follows

book@100ask:~/workspaces/e907_rtos/rtos/source$ lunch

You're building on Linux 100ask 5.4.0-148-generic #165~18.04.1-Ubuntu SMP Thu Apr 20 01:14:06 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Lunch menu... pick a combo:
The supported board:
    1. v851-e907-lizard
    2. v851-e907-lizard-tinymaix
    3. v853-e907-100ask
    4. v853-e907-100ask-tinymaix
What is your choice? 3
You have select v853-e907-100ask 
============================================
Project Based On Platform sun20iw3p1 v853-e907-100ask
============================================

At this point you can compile, entermake

book@100ask:~/workspaces/e907_rtos/rtos/source$ make
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/melis/version.h
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
  UPD     include/generated/uapi/melis/version.h
  CHK     include/generated/utsrelease.h
  CC      sysconfig.fex
  CC      ekernel/arch/common/common.o
  LD      ekernel/arch/common/built-in.o
  AS      ekernel/arch/riscv/sunxi/blobdata.o
  LD      ekernel/arch/riscv/sunxi/built-in.o
  LD      ekernel/arch/riscv/built-in.o
  LD      ekernel/arch/built-in.o
  LD      ekernel/built-in.o
  LD [M]  ekernel/melis30.o
/home/book/workspaces/e907_rtos/rtos/source/../toolchain/riscv64-elf-x86_64-20201104//bin/riscv64-unknown-elf-ld: ekernel/melis30.o: section .dram_seg.stack lma 0x43c3a2b8 adjusted to 0x43c3a34c
  OBJCOPY ekernel/melis30.bin
  RENAME  ekernel/melis30.o ----> ekernel/melis30.elf
/home/book/workspaces/e907_rtos/rtos/source/../toolchain/riscv64-elf-x86_64-20201104//bin/riscv64-unknown-elf-strip: ekernel/stW7SdkR: section .dram_seg.stack lma 0x43c3a2b8 adjusted to 0x43c3a34c

   text    data     bss     dec     hex filename
 221280   17132   25488  263900   406dc ekernel/melis30.elf

  pack    melis

#### make completed successfully (11 seconds) ####

ekernel/After the compilation is complete, a melis30.elffile will be generated under the current directory , which can be used to start the small core.

1.2 E907 Configuration Items

​ The configuration of the E907 development kit is similar to that of the Tina SDK. In e907_rtos/rtos/sourcethe directory, executemake menuconfig

For example:

book@100ask:~/workspaces/e907_rtos/rtos/source$ make menuconfig

After the execution is completed, you will enter the following interface:
insert image description here

2. Load E907 small core

2.1 Tina configuration

2.1.1 Device tree configuration

​ In the Tina root directory, enter the device tree directory

book@100ask:~/workspaces/tina-v853-open$ cd device/config/chips/v853/configs/100ask/

Edit device tree

book@100ask:~/workspaces/tina-v853-open/device/config/chips/v853/configs/100ask$ vi board.dts 

Find the device tree node related to E907 in the device tree file. The default setting of the device tree is:

reserved-memory {
                e907_dram: riscv_memserve {
                        reg = <0x0 0x48000000 0x0 0x00400000>;
                        no-map;
                };

                vdev0buffer: vdev0buffer@47000000 {
                        /* 256k reserved for shared mem pool */
                        compatible = "shared-dma-pool";
                        reg = <0x0 0x47000000 0x0 0x40000>;
                        no-map;
                };

                vdev0vring0: vdev0vring0@47040000 {
                        reg = <0x0 0x47040000 0x0 0x20000>;
                        no-map;
                };

                vdev0vring1: vdev0vring1@47060000 {
                        reg = <0x0 0x47060000 0x0 0x20000>;
                        no-map;
                };
        };

        e907_rproc: e907_rproc@0 {
                compatible = "allwinner,sun8iw21p1-e907-rproc";
                clock-frequency = <600000000>;
                memory-region = <&e907_dram>, <&vdev0buffer>,
                                                <&vdev0vring0>, <&vdev0vring1>;

                mboxes = <&msgbox 0>;
                mbox-names = "mbox-chan";
                iommus = <&mmu_aw 5 1>;

                memory-mappings =
                /* DA            len         PA */
                        /* DDR for e907  */
                        < 0x48000000 0x00400000 0x48000000 >;
                core-name = "sun8iw21p1-e907";
                firmware-name = "melis-elf";
                status = "okay";
        };

        rpbuf_controller0: rpbuf_controller@0 {
                compatible = "allwinner,rpbuf-controller";
                remoteproc = <&e907_rproc>;
                ctrl_id = <0>;  /* index of /dev/rpbuf_ctrl */
                iommus = <&mmu_aw 5 1>;
                status = "okay";
        };

        rpbuf_sample: rpbuf_sample@0 {
                compatible = "allwinner,rpbuf-sample";
                rpbuf = <&rpbuf_controller0>;
                status = "okay";
        };

Since we need to use uart3the print information of the E907 small core, in order to prevent kernel preemption uart3, we need to disable uart3the node

&uart3 {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&uart3_pins_active>;
        pinctrl-1 = <&uart3_pins_sleep>;
        uart-supply = <&reg_dcdc1>;
        status = "okay";
};

Modify device tree reuse

uart3_pins_active: uart3@0 {
                allwinner,pins = "PH0", "PH1";
                allwinner,function = "uart3";
                allwinner,muxsel = <5>;
                allwinner,drive = <1>;
                allwinner,pull = <1>;
        };

        uart3_pins_sleep: uart3@1 {
                allwinner,pins = "PH0", "PH1";
                allwinner,function = "gpio_in";
                allwinner,muxsel = <0>;
        };

2.1.2 Kernel configuration

In the Tina root directory, execute make kernel_menuconfig, for example:

book@100ask:~/workspaces/tina-v853-open$ make kernel_menuconfig

1. Enable hardware support

After entering the kernel configuration interface, enter Device Drivers the directory and select it Mailbox Hardware Support, as shown in the figure below

insert image description here

After selecting, enter Mailbox Hardware Supportthe directory, select sunxi Mailboxand sunxi rv32 standby driver, and the selection is completed, as shown in the figure below:
insert image description here

2. Enable the RPMsg driver

Enter the following directory

→ Device Drivers 
	→ Rpmsg drivers

Select the following configuration

<*> allwinnertech rpmsg driver for v853-e907
<*> allwinnertech rpmsg hearbeat driver
<*> sunxi rpmsg ctrl driver
<*> Virtio RPMSG bus driver 

After the selection is completed, it will be shown as the following figure:

insert image description here

3. Enable the shared memory driver

​ Enter the following directory

→ Device Drivers 
	→ Remoteproc drivers 

Select the following configuration

<*> SUNXI remote processor support  --->

As shown below:
insert image description here

After modification, save the kernel configuration and exit.

2.1.3 Compile a new image

In the root directory of Tina, enter and makecompile the kernel driver you just selected. After the compilation is complete, enter packand package to generate a new image. For example:

book@100ask:~/workspaces/tina-v853-open$ make
...
book@100ask:~/workspaces/tina-v853-open$ pack
...

After generating a new image, copy the generated v853_linux_100ask_uart0.imgfile to the Windows host.

2.2 E907 configuration

2.2.1 Modify the E907 link script

​ Enter the directory e907_rtos/rtos/source/projects/v853-e907-100askand find kernel.ldsthe file, which saves the link information of the E907 small core.

book@100ask:~/workspaces/e907_rtos/rtos/source/projects/v853-e907-100ask$ ls
configs  data  epos.img  kernel.lds  src  version

Modify kernel.lds, find MEMORYthe node, modify the starting address to 0x48000000, and the length to 0x00400000. This parameter needs to be consistent with the E907 memory parameter in the Tina device tree, so the modifiable MEMORYnode parameters are:

MEMORY
{
   /*DRAM_KERNEL: 4M */
   DRAM_SEG_KRN (rwx) : ORIGIN = 0x48000000, LENGTH = 0x00400000
}

The comparison chart between the two is as follows:

insert image description here

What is used here 0x48000000is assuming that V853 has 128M of memory, and the hexadecimal value can be set to be 0x48000000; the length is 4M, and the hexadecimal value is0x00400000

2.2.2 Modify E907 configuration

Enter e907_rtos/rtos/source/projects/v853-e907-100ask/configsthe directory and modify defconfigthe file, for example:

book@100ask:~/workspaces/e907_rtos/rtos/source/projects/v853-e907-100ask$ cd configs/
book@100ask:~/workspaces/e907_rtos/rtos/source/projects/v853-e907-100ask/configs$ ls
defconfig  sys_config.fex

Modify the following three parameters to:

CONFIG_DRAM_PHYBASE=0x48000000
CONFIG_DRAM_VIRTBASE=0x48000000
CONFIG_DRAM_SIZE=0x0400000

As shown below:
insert image description here

2.2.3 Use uart3 to output information

1. Modify pin multiplexing

Configure the pin multiplexing file and enter e907_rtos/rtos/source/projects/v853-e907-100ask/configsthe directory

Modify sys_config.fexthe file, check the pin multiplexing function by querying the data sheet, we use PH0 and PH1 as uart3the function

insert image description here

Modify the uart3 node as:

[uart3]
uart_tx         = port:PH00<5><1><default><default>
uart_rx         = port:PH01<5><1><default><default>

2. Modify the configuration

e907_rtos/rtos/sourceEnter in the directory make menuconfigto enter the E907 configuration interface

Enter the following directory, select[*] Support Serial Driver

 → Kernel Setup 
 	→ Drivers Setup 
 		→ Melis Source Support
 			[*] Support Serial Driver

insert image description here

Enter the following directory, select it [*] enable sysconfig, and enable the function of reading and parsing sys_config.fex

 → Kernel Setup 
 	→ Drivers Setup 
 		→ SoC HAL Drivers 
 			→ Common Option 
 				[*] enable sysconfig

insert image description here

Enter the following directory, enable the uart driver, and use uart3.

 → Kernel Setup 
 	→ Drivers Setup 
 		→ SoC HAL Drivers 
 			→ UART Devices
 				[*] enable uart driver 
 				[*]   support uart3 device
 				(3)   cli uart port number 

insert image description here

Enter the following directory and enable the sys_config.fex parser

 → Kernel Setup 
 	→ Subsystem support 
 		→ devicetree support 
 			[*] support traditional fex configuration method parser. 

insert image description here

Save and exit E907 configuration.

2.2.4 Compile and generate a new image

In workspaces/e907_rtos/rtos/sourcethe directory, entermake

book@100ask:~/workspaces/e907_rtos/rtos/source$ make
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/melis/version.h
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
  UPD     include/generated/uapi/melis/version.h
  CHK     include/generated/utsrelease.h
  CC      sysconfig.fex
  CC      ekernel/arch/common/common.o
  LD      ekernel/arch/common/built-in.o
  AS      ekernel/arch/riscv/sunxi/blobdata.o
  LD      ekernel/arch/riscv/sunxi/built-in.o
  LD      ekernel/arch/riscv/built-in.o
  LD      ekernel/arch/built-in.o
  LD      ekernel/built-in.o
  LD [M]  ekernel/melis30.o
/home/book/workspaces/e907_rtos/rtos/source/../toolchain/riscv64-elf-x86_64-20201104//bin/riscv64-unknown-elf-ld: ekernel/melis30.o: section .dram_seg.stack lma 0x4803a2b8 adjusted to 0x4803a34c
  OBJCOPY ekernel/melis30.bin
  RENAME  ekernel/melis30.o ----> ekernel/melis30.elf
/home/book/workspaces/e907_rtos/rtos/source/../toolchain/riscv64-elf-x86_64-20201104//bin/riscv64-unknown-elf-strip: ekernel/stWPSq13: section .dram_seg.stack lma 0x4803a2b8 adjusted to 0x4803a34c

   text    data     bss     dec     hex filename
 221280   17132   25488  263900   406dc ekernel/melis30.elf

  pack    melis

#### make completed successfully (7 seconds) ####

After the compilation is complete, it will ekernelbe generated in the directory melis30.elf.

2.3 Check the development board hardware

​ After testing, it is found that the R36 resistor on the 100ASK_V853-PRO development board will cause uart3the baud rate to be too high, so it is necessary to check whether the R36 resistor on the development board exists, and if it exists, it needs to be removed manually. The figure below shows the location of the R36 resistor, and the red box is the R36 resistor

insert image description here

If the resistor needs to be removed manually, the following figure is a schematic diagram of removing the R36 resistorinsert image description here

After removing the R36 resistor, uart3the serial port can be accessed normally.

2.4 Enable E907 in the development board

Use the Allwinner programming tool AllwinnertechPhoeniSuitto update the new image of Tina, for details, please refer to https://forums.100ask.net/t/topic/2882

After the update is complete, open the serial port terminal to enter the development board console, and melis30.elfcopy it to /lib/firmwarethe directory.

Suppose I use the ADB function to copy the file to root/the directory of the development board

root@TinaLinux:~# cd /root/
root@TinaLinux:~# ls
melis30.elf

Copy rootthe contents of the directory melis30.elfto /lib/firmwarethe directory

root@TinaLinux:~# cp melis30.elf /lib/firmware/
root@TinaLinux:~# ls /lib/firmware/
boot_xr829.bin   fw_xr829.bin     melis30.elf      sdd_xr829.bin
etf_xr829.bin    fw_xr829_bt.bin  regulatory.db

After the copy is complete, you can /lib/firmwaresee the small core firmware in the directory.

2.4.1 Connect the uart3 of the development board

​ At this time, you need to use the USB-to-serial port module to connect to the one we set above uart3. We need to find PH0, PH1, and GND on the development board, and connect them to RXD, TXD, and GND of the USB-to-serial module, respectively. The 100ASK_V853-PRO development board has led out PH0, PH1, and GND, as shown in the location diagram below
insert image description here

For specific pins, you can check the silkscreen on the back of the development board to confirm the pin positions.

insert image description here

The positions of PH0, PH1, and GND can be known through the silk screen on the back. As shown in the figure below, PH0, PH1, and GND are respectively connected to RX, TX, and GND of the USB-to-serial port module.

insert image description here

After the connection is complete, insert the USB-to-serial port module into the windows host, and use the serial port software to open the uart3 serial port interface with a baud rate of 115200.

Enter in the serial port terminal of the Tina Linux development board

root@TinaLinux:~# echo melis30.elf > /sys/kernel/debug/remoteproc/remoteproc0/firmware 

Put melis30.elfthe firmware under the hardware node firmware and start the E907 firmware

root@TinaLinux:~# echo start > /sys/kernel/debug/remoteproc/remoteproc0/state
[ 3926.510018]  remoteproc0: powering up e907_rproc
[ 3926.515440]  remoteproc0: failed to parser head (melis30.elf) ret=-2
[ 3926.522674]  remoteproc0: failed to read boot_package item
[ 3926.528930]  remoteproc0: request_firmware failed from boot_package: -14
[ 3926.537528] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 3926.543964]  remoteproc0: registered virtio0 (type 7)
[ 3926.550538]  remoteproc0: remote processor e907_rproc is now up
root@TinaLinux:~# [ 3926.560537] virtio_rpmsg_bus virtio0: creating channel rpbuf-service addr 0x400
[ 3926.569199] virtio_rpmsg_bus virtio0: creating channel sunxi,rpmsg_heartbeat addr 0x401
[ 3926.578725] virtio_rpmsg_bus virtio0: creating channel sunxi,notify addr 0x402
[ 3926.587194] virtio_rpmsg_bus virtio0: creating channel sunxi,rpmsg_ctrl addr 0x403

After enabling it, you can see the following print information on another serial port interface

|commitid: 
|halgitid: 
|timever : Thu, 04 May 2023 04:22:23 -0400

scheduler startup
msh >Start Rpmsg Hearbeat Timer
rpmsg ctrldev: Start Running...

Press Enter to enter the terminal interface.

Enter psto see the small core process information

msh >ps
thread                           pri  status      sp     stack size max used left tick  error
-------------------------------- ---  ------- ---------- ----------  ------  ---------- ---
tshell                            21  ready   0x000003e8 0x00004000    19%   0x00000008 000
ctrldev                            6  suspend 0x00000148 0x00001000    08%   0x0000000a 000
rpmsg_srm                          8  suspend 0x000000f8 0x00000800    22%   0x0000000a 000
vring-ipi                         15  suspend 0x00000118 0x00002000    03%   0x0000000a 000
rpbuf_init                         8  suspend 0x000000e8 0x00001000    12%   0x0000000a 000
standby                            1  suspend 0x00000128 0x00001000    07%   0x0000000a 000
tidle                             31  ready   0x00000178 0x00002000    04%   0x0000001e 000
timer                              8  suspend 0x000000d8 0x00000200    73%   0x0000000a 000

3. Binuclear communication

3.1 E907 small core to create a communication node

Establish two communication nodes on the E907 small-core serial port terminal to monitor data, inputeptdev_bind test 2

msh >eptdev_bind test 2

To view the listening node, enterrpmsg_list_listen

msh >rpmsg_list_listen
name             listen  alive
test             2  0
console                  100  0

3.2 Large core creates communication nodes

Also create two communication monitoring nodes under Tina LInux, enter the following two commands

echo test > /sys/class/rpmsg/rpmsg_ctrl0/open
echo test > /sys/class/rpmsg/rpmsg_ctrl0/open

After entering, it looks like this:

root@TinaLinux:~# echo test > /sys/class/rpmsg/rpmsg_ctrl0/open
[ 5060.227158] virtio_rpmsg_bus virtio0: creating channel sunxi,rpmsg_client addr 0x404
s/rpmsg/rpmsg_ctrl0/openroot@TinaLinux:~# echo test > /sys/class/rpmsg/rpmsg_ctrl0/open
[ 5061.464758] virtio_rpmsg_bus virtio0: creating channel sunxi,rpmsg_client addr 0x405

Two monitoring nodes are also created in the big core TIna Linux, enter to ls /dev/rpmsg*view the node information

root@TinaLinux:~# ls /dev/rpmsg*
/dev/rpmsg0       /dev/rpmsg1       /dev/rpmsg_ctrl0

After the creation is complete, you can view the automatically output information in the E907 small core terminal.

msh >ctrldev: Rx 44 Bytes
client: Rx 8 Bytes
rpmsg0: binding
send 0x13131411 to rpmsg0
create rpmsg0 client success
ctrldev: Rx 44 Bytes
client: Rx 8 Bytes
rpmsg1: binding
send 0x13131411 to rpmsg1
create rpmsg1 client success

3.3 Transfer from large core to E907 small core

Type in Tina LInux

echo "hello 100ASK_V853-PRO" > /dev/rpmsg0
echo "hello Tina Linux" > /dev/rpmsg1

Transfer Linux Message 0the information to the E907 small core through the created listening node, for example:

root@TinaLinux:~# echo "hello 100ASK_V853-PRO" > /dev/rpmsg0
root@TinaLinux:~# echo "hello Tina Linux" > /dev/rpmsg1

After inputting, open the E907 serial port terminal to find the information transmitted by the big core.

rpmsg0: Rx 22 Bytes
Data:hello 100ASK_V853-PRO

rpmsg1: Rx 17 Bytes
Data:hello Tina Linux

3.4 Transfer from E907 small core to large core

eptdev_send​ You need to use the command usage on the small core side . The number eptdev_send <id> <data>here starts from 0. We set up two communication nodes, so the id numbers are 0 and 1 respectively.id

​ Enter the following command on the serial terminal of the small core:

eptdev_send 0 "hello E907"
eptdev_send 1 "hello E907"

For example:

msh >eptdev_send 0 "hello E907"
will send hello E907 to rpmsg0
msh >eptdev_send 1 "hello E907"
will send hello E907 to rpmsg1

After the input is completed, the small core will transfer the information to the two communication nodes rpmsg0 and rpmsg1 respectively. It can be input on the big core Tina Linux side

cat /dev/rpmsg0
cat /dev/rpmsg1

You can view the information transmitted from the E907 small core. For example:

root@TinaLinux:~# cat /dev/rpmsg0
hello E907
^C
root@TinaLinux:~# cat /dev/rpmsg1
hello E907
^C

Press Crtl+C to continue monitoring the node before ending the monitoring.

​ You can transmit information to this node multiple times on the small core side, and this node supports continuous acceptance of information transmitted by the small core, for example:

In the E907 small core, transmit information to the listening node multiple timesrpmsg0

msh >eptdev_send 0 "hello E907 "
will send hello E907  to rpmsg0
msh >eptdev_send 0 "hello E907 "
will send hello E907  to rpmsg0
msh >eptdev_send 0 "hello E907 "
will send hello E907  to rpmsg0
msh >eptdev_send 0 "hello E907 "
will send hello E907  to rpmsg0
msh >eptdev_send 0 "hello E907 "
will send hello E907  to rpmsg0
msh >eptdev_send 0 "hello E907 "
will send hello E907  to rpmsg0
msh >eptdev_send 0 "hello E907 "
will send hello E907  to rpmsg0

At the end of the large core, it will always receive the information transmitted by the small core

root@TinaLinux:~# cat /dev/rpmsg0
hello E907 hello E907 hello E907 hello E907 hello E907 hello E907 hello E907 

3.5 Closing communication

​ On the big-core Tina Linux side, just operate the node, enter the following command, echo <id>give the control of rpmsg to close the node

echo 0 > /sys/class/rpmsg/rpmsg_ctrl0/close
echo 1 > /sys/class/rpmsg/rpmsg_ctrl0/close

For example:

root@TinaLinux:~# echo 0 > /sys/class/rpmsg/rpmsg_ctrl0/close
[ 6783.156899] virtio_rpmsg_bus virtio0: destroying channel sunxi,rpmsg_client addr 0x404
root@TinaLinux:~# echo 1 > /sys/class/rpmsg/rpmsg_ctrl0/close
root@TinaLinux:~# [ 6784.224740] virtio_rpmsg_bus virtio0: destroying channel sunxi,rpmsg_client addr 0x405

​ At this time, the E907 small core terminal will also automatically close the communication node, and automatically output the following information

send 0x13131411 to rpmsg0
rpmsg0: unbinding
ctrldev: Rx 44 Bytes
send 0x13131411 to rpmsg1
rpmsg1: unbinding

Guess you like

Origin blog.csdn.net/thisway_diy/article/details/130635905