summaryrefslogtreecommitdiff
path: root/bsp/phytium/libraries/port/openamp_port/README.md
blob: a527981c214702220048c9a220543b502f605ff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Summary

This directory contains legacy applications and tests examples.
These applications were moved from open-amp repository.


# Initialization

The first step is to initialize the workspace folder (``my-workspace``) where
the examples and all Zephyr modules will be cloned. You can do
that by running:

```shell
# initialize my-workspace for the example-application (main branch)
west init -m https://github.com/OpenAMP/openamp-system-reference --mf examples/legacy_apps/west.yml --mr main my-workspace
# update modules
cd my-workspace
west update
```

# Build

Following steps to build legacy apps on host machine.

```
export PROJECT_ROOT=$PWD
```

## Build libmetal
```shell
  $ cd $PROJECT_ROOT/libmetal
  $ cmake . -Bbuild -DCMAKE_INSTALL_PREFIX=$PROJECT_ROOT/target
  $ make -C build VERBOSE=1 install
```

## Build open_amp
```shell
  $ cd $PROJECT_ROOT/open-amp
  $ cmake . -Bbuild -DCMAKE_INCLUDE_PATH=$PROJECT_ROOT/libmetal/build/lib/include/   -DCMAKE_LIBRARY_PATH=$PROJECT_ROOT/libmetal/build/lib/ -DCMAKE_INSTALL_PREFIX=$PROJECT_ROOT/target
  $ make -C build VERBOSE=1 install
```
## Build legacy Apps
```shell
  $ cd $PROJECT_ROOT/openamp-system-reference/examples/legacy_apps
  $ cmake -Bbuild \
-DCMAKE_INCLUDE_PATH="$PROJECT_ROOT/libmetal/build/lib/include/;$PROJECT_ROOT/open-amp/build/lib/include/" \
-DCMAKE_LIBRARY_PATH="$PROJECT_ROOT/libmetal/build/lib/;$PROJECT_ROOT/open-amp/build/lib/" \
-DCMAKE_INSTALL_PREFIX=$PROJECT_ROOT/target
  $ make -C build VERBOSE=1 install
```

## Run application on a Linux PC
It is possible to run application on a Linux PC to communicate between two Linux processes.

```shell
  $ cd $PROJECT_ROOT/target
  $ echo "################### run ping test #####################"
  $ LD_LIBRARY_PATH=./lib  ./bin/rpmsg-echo-static &
  $ sleep 1
  $ LD_LIBRARY_PATH=./lib  ./bin//msg-test-rpmsg-ping-static 1

  $ echo "################### run ping test #####################"
  $ LD_LIBRARY_PATH=./lib  ./bin/rpmsg-nocopy-echo-static &
  $ sleep 1
  $ LD_LIBRARY_PATH=./lib  ./bin//rpmsg-nocopy-ping-static  1
```