You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
eRPC (Embedded RPC) is an open source Remote Procedure Call (RPC) system for multichip embedded systems and heterogeneous multicore SoCs.
10
10
11
11
Unlike other modern RPC systems, such as the excellent [Apache Thrift](http://thrift.apache.org), eRPC distinguishes itself by being designed for tightly coupled systems, using plain C for remote functions, and having a small code size (<5kB). It is not intended for high performance distributed systems over a network.
@@ -16,7 +16,7 @@ A code generator tool called `erpcgen` is included. It accepts input IDL files,
16
16
17
17
Example `.erpc` file:
18
18
19
-
~~~~~{java}
19
+
```java
20
20
// Define a data type.
21
21
enumLEDName { kRed, kGreen, kBlue }
22
22
@@ -25,10 +25,11 @@ interface IO {
25
25
// Simple function declaration with an empty reply.
26
26
set_led(LEDNamewhichLed, boolonOrOff) -> void
27
27
}
28
-
~~~~~
28
+
```
29
29
30
30
Client side usage:
31
-
~~~~~{c}
31
+
32
+
```C
32
33
voidexample_client(void) {
33
34
// Initialize client running over UART.
34
35
erpc_client_init(
@@ -38,10 +39,11 @@ void example_client(void) {
38
39
// Now we can call the remote function to turn on the green LED.
39
40
set_led(kGreen, true);
40
41
}
41
-
~~~~~
42
+
```
42
43
43
44
Server side usage:
44
-
~~~~~{c}
45
+
46
+
```C
45
47
// Implement the remote function.
46
48
voidset_led(LEDNamewhichLed, boolonOrOff) {
47
49
// implementation goes here
@@ -59,7 +61,7 @@ void example_server(void) {
59
61
// Run the server.
60
62
erpc_server_run();
61
63
}
62
-
~~~~~
64
+
```
63
65
64
66
A number of transports are supported, and new transport classes are easy to write.
65
67
@@ -90,16 +92,23 @@ eRPC is available with an unrestrictive BSD 3-clause license. See the [LICENSE f
90
92
91
93
[Example IDL](examples/README.md) is available in the `examples/` folder.
92
94
93
-
Plenty of eRPC multicore and multiprocessor examples can be also found in NXP MCUXpressoSDK packages. Visit [https://mcuxpresso.nxp.com](https://mcuxpresso.nxp.com) to configure, build and download these packages.<br>
94
-
To get the board list with multicore support (eRPC included) use filtering based on Middleware and search for 'multicore' string. Once the selected package with the multicore middleware is downloaded, see<br>
95
-
<MCUXpressoSDK_install_dir>/boards/<board_name>/multicore_examples for eRPC multicore examples (RPMsg_Lite or Messaging Unit transports used) or<br>
96
-
<MCUXpressoSDK_install_dir>/boards/<board_name>/multiprocessor_examples for eRPC multiprocessor examples (UART or SPI transports used).<br>
95
+
Plenty of eRPC multicore and multiprocessor examples can be also found in NXP MCUXpressoSDK packages. Visit [https://mcuxpresso.nxp.com](https://mcuxpresso.nxp.com) to configure, build and download these packages.
96
+
97
+
To get the board list with multicore support (eRPCincluded) use filtering based on Middleware and search for 'multicore' string. Once the selected package with the multicore middleware is downloaded, see
98
+
99
+
<MCUXpressoSDK_install_dir>/boards/<board_name>/multicore_examples for eRPC multicore examples (RPMsg_LiteorMessagingUnittransportsused) or
100
+
101
+
<MCUXpressoSDK_install_dir>/boards/<board_name>/multiprocessor_examples for eRPC multiprocessor examples (UARTorSPItransportsused).
102
+
97
103
eRPC examples use the 'erpc_' name prefix.
98
104
99
105
Another way of getting NXP MCUXpressoSDK eRPC multicore and multiprocessor examples is using the [mcux-sdk](https://github.com/NXPmicro/mcux-sdk) Github repo. Follow the description how to use the West tool
100
-
to clone and update the mcuxsdk repo in [readme Overview section](https://github.com/NXPmicro/mcux-sdk#overview). Once done the armgcc eRPC examples can be found in<br>
101
-
mcuxsdk/examples/<board_name>/multicore_examples or in<br>
to clone and update the mcuxsdk repo in [readme Overview section](https://github.com/NXPmicro/mcux-sdk#overview). Once done the armgcc eRPC examples can be found in
107
+
108
+
mcuxsdk/examples/<board_name>/multicore_examples or in
You can use the evkmimxrt1170 as the board_name for instance. Similar to MCUXpressoSDK packages the eRPC examples use the 'erpc_' name prefix.
104
113
105
114
## References
@@ -132,7 +141,6 @@ This section provides links to interesting erpc-based projects, articles, blogs
132
141
133
142
`utilities` - Holds utilities which bring additional benefit to eRPC apps developers.
134
143
135
-
136
144
## Building and installing
137
145
138
146
These build instructions apply to host PCs and embedded Linux. For bare metal or RTOS embedded environments, you should copy the `erpc_c` directory into your application sources.
@@ -153,6 +161,7 @@ Steps are described in [`erpcgen/VisualStudio_v14/readme_erpcgen.txt`](erpcgen/V
@@ -176,24 +187,31 @@ Install these packages with [homebrew](http://brew.sh/):
176
187
177
188
To build the library and erpcgen, run from the repo root directory:
178
189
179
-
% make
190
+
```sh
191
+
make
192
+
```
180
193
181
194
To install the library, erpcgen, and include files, run:
182
195
183
-
% make install
196
+
```sh
197
+
make install
198
+
```
184
199
185
200
You may need to sudo the `make install`.
186
201
187
202
By default this will install into `/usr/local`. If you want to install elsewhere, set the `PREFIX` environment variable. Example for installing into `/opt`:
188
203
189
-
% make install PREFIX=/opt
204
+
```sh
205
+
make install PREFIX=/opt
206
+
```
190
207
191
208
List of top level Makefile targets:
192
-
-`erpc`: build the liberpc.a static library
193
-
-`erpcgen`: build the erpcgen tool
194
-
-`test`: build the unit tests under the `test/` directory
195
-
-`all`: build all of the above
196
-
-`install`: install liberpc.a, erpcgen, and include files
209
+
210
+
* `erpc`: build the liberpc.a static library
211
+
* `erpcgen`: build the erpcgen tool
212
+
* `test`: build the unit tests under the `test/` directory
213
+
* `all`: build all of the above
214
+
* `install`: install liberpc.a, erpcgen, and include files
197
215
198
216
eRPC code is validated with respect to the C++ 11 standard.
199
217
@@ -202,7 +220,8 @@ eRPC code is validated with respect to the C++ 11 standard.
202
220
To install the Python infrastructure for eRPC see instructions in the [erpc_python folder readme](erpc_python/readme.md).
203
221
204
222
## Known issues and limitations
205
-
- Static allocations controlled by the ERPC_ALLOCATION_POLICY config macro are not fully supported yet, i.e. not all erpc objects can be allocated statically now. It deals with the ongoing process and the full static allocations support will be added in the future.
223
+
224
+
* Static allocations controlled by the ERPC_ALLOCATION_POLICY config macro are not fully supported yet, i.e. not all erpc objects can be allocated statically now. It deals with the ongoing process and the full static allocations support will be added in the future.
The eRPC generator (erpcgen) is a tool which generates the shim code for a server and client side. The generated shim code handles marshaling and unmarshaling a request. On the server side after unmarshaling, it implements a function call to the appropriate function based on request. An IDL (Interface Definition Language) is used to tell the generator tool about data types and RPC services.
0 commit comments