Skip to content

Commit 7c54ff6

Browse files
committed
Add openamp+RPC without hurting nRF board
1 parent 052ed4d commit 7c54ff6

30 files changed

+41
-6
lines changed

boards.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ envie_m4.compiler.mbed.cflags={build.variant.path}/cflags.txt
4949
envie_m4.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
5050
envie_m4.compiler.mbed.includes={build.variant.path}/includes.txt
5151
envie_m4.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
52-
envie_m4.compiler.mbed="{build.variant.path}/libs/libmbed.a"
52+
envie_m4.compiler.mbed="{build.variant.path}/libs/libmbed.a" "{build.variant.path}/libs/libopenamp.a"
5353
envie_m4.vid.0=0x0483
5454
envie_m4.pid.0=0x374e
5555

cores/arduino/RPC.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifdef TARGET_STM32H747_CM4
2+
13
#include "RPC.h"
24

35
int RPC::rpmsg_recv_service_callback(struct rpmsg_endpoint *ept, void *data,
@@ -79,3 +81,5 @@ int RPC::request(service_request* s) {
7981
}
8082

8183
arduino::RPC RPC1;
84+
85+
#endif

cores/arduino/RPC.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#ifdef __cplusplus
2+
#ifdef TARGET_STM32H747_CM4
23

34
#ifndef __ARDUINO_RPC_IMPLEMENTATION__
45
#define __ARDUINO_RPC_IMPLEMENTATION__
@@ -65,5 +66,6 @@ class RPC : public Stream {
6566

6667
extern arduino::RPC RPC1;
6768

69+
#endif
6870
#endif
6971
#endif

cores/arduino/openamp/openamp/open_amp.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#ifndef OPEN_AMP_H_
99
#define OPEN_AMP_H_
1010

11-
#include <openamp/rpmsg.h>
12-
#include <openamp/rpmsg_virtio.h>
13-
#include <openamp/remoteproc.h>
14-
#include <openamp/remoteproc_virtio.h>
11+
#include "rpmsg.h"
12+
#include "rpmsg_virtio.h"
13+
#include "remoteproc.h"
14+
#include "remoteproc_virtio.h"
1515

1616

1717
#endif /* OPEN_AMP_H_ */

cores/arduino/openamp/openamp/rpmsg.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef _RPMSG_H_
1313
#define _RPMSG_H_
1414

15-
#include <openamp/compiler.h>
15+
#include "compiler.h"
1616
#include <metal/mutex.h>
1717
#include <metal/list.h>
1818
#include <string.h>
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Use this file to produce an archive in {build_dir}/libraries/openamp/openamp.a, then move it to variants/ENVIE_M4/libs/libopenamp.a
2+
3+
#include "arduino_openamp.h"
4+
#include "RPC.h"
5+
6+
void setup() {
7+
RPC1.begin();
8+
Serial.begin(115200);
9+
}
10+
11+
void loop() {
12+
if (RPC1.available() > 10) {
13+
Serial.print("I have new stuff ");
14+
Serial.println(RPC1.available());
15+
while (RPC1.available()) {
16+
Serial.write(RPC1.read());
17+
}
18+
}
19+
}

libraries/openamp/library.properties

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name=openamp
2+
version=1.0
3+
author=Arduino
4+
maintainer=Arduino <[email protected]>
5+
sentence=Enables the communication between H747 cores via shared memory and openAMP library.
6+
paragraph=
7+
category=Communication
8+
url=
9+
architectures=mbed
10+
dot_a_linkage=true

libraries/openamp/src/arduino_openamp.h

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

variants/ENVIE_M4/libs/libopenamp.a

118 KB
Binary file not shown.

0 commit comments

Comments
 (0)