Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RPC: Update openamp config and RPC examples.#830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
iabdalkader merged 2 commits intoarduino:mainfromiabdalkader:update_openamp_config
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletionslibraries/RPC/examples/Basic_AddSub/Basic_AddSub.ino
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,22 +4,46 @@ int add(int a, int b) {
return a + b;
}

void setup() {
int sub(int a, int b) {
return a - b;
}

void setup() {
Serial.begin(115200);
while (!Serial) {

}

RPC.begin();
RPC.bind("add", add);
RPC.bind("sub", sub);
if (HAL_GetCurrentCPUID() == CM7_CPUID) {
// Introduce a brief delay to allow the M4 sufficient time
// to bind remote functions before invoking them.
delay(100);
}
pinMode(LEDG, OUTPUT);
}

void loop() {
static size_t loop_count = 0;

// Blink every 512 iterations
if ((loop_count++ % 512) == 0) {
if (HAL_GetCurrentCPUID() == CM4_CPUID &&(loop_count++ % 512) == 0) {
digitalWrite(LEDG, LOW);
delay(10);
digitalWrite(LEDG, HIGH);
delay(10);
}

int res = RPC.call("add", 1, 2).as<int>();
RPC.call("sub", res, 1).as<int>();
if (HAL_GetCurrentCPUID() == CM7_CPUID) {
Serial.println("add(1, 2) = " + String(res));
}

res = RPC.call("sub", res, 1).as<int>();
if (HAL_GetCurrentCPUID() == CM7_CPUID) {
Serial.println("sub(3, 1) = " + String(res));
}
delay(250);
}
4 changes: 3 additions & 1 deletionlibraries/RPC/examples/MD5_Checksum/MD5_Checksum.ino
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ size_t hash_out_count = 0;
#ifdef CORE_CM4
size_t data_buf_size = 0;
#else
size_t data_buf_size =512;
size_t data_buf_size =256;
#endif

typedef std::vector<byte> vec_t;
Expand DownExpand Up@@ -59,6 +59,8 @@ void setup() {
#ifdef CORE_CM4
RPC.bind("set_buffer_size", set_buffer_size);
#else
// Introduce a brief delay to allow the M4 sufficient time
// to bind remote functions before invoking them.
delay(100);
auto ret = RPC.call("set_buffer_size", data_buf_size).as<size_t>();
#endif
Expand Down
2 changes: 1 addition & 1 deletionlibraries/openamp_arduino/src/openamp_conf.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,7 +158,7 @@ extern int __OPENAMP_region_end__[];
#define VRING_BUFF_ADDRESS (SHM_START_ADDRESS + 0x2000)
#define VRING_BUFF_SIZE (SHM_SIZE - 0x2000)
#define VRING_ALIGNMENT 32
#define VRING_NUM_BUFFS16 /* number of rpmsg buffers */
#define VRING_NUM_BUFFS64 /* number of rpmsg buffers */

/* Fixed parameter */
#define NUM_RESOURCE_ENTRIES 2
Expand Down
2 changes: 1 addition & 1 deletionvariants/GENERIC_STM32H747_M4/conf/mbed_app.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,7 +22,7 @@
"VIRTIO_DEVICE_ONLY",
"NO_ATOMIC_64_SUPPORT",
"METAL_MAX_DEVICE_REGIONS=2",
"RPMSG_BUFFER_SIZE=2048"
"RPMSG_BUFFER_SIZE=512"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletionvariants/GENERIC_STM32H747_M4/defines.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,7 +52,7 @@
-DMETAL_MAX_DEVICE_REGIONS=2
-DNO_ATOMIC_64_SUPPORT
-DNO_VTOR_RELOCATE
-DRPMSG_BUFFER_SIZE=2048
-DRPMSG_BUFFER_SIZE=512
-DSTM32H747xx
-DTARGET_CORDIO
-DTARGET_CORTEX
Expand Down
2 changes: 1 addition & 1 deletionvariants/GIGA/conf/mbed_app.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@
"VIRTIO_DRIVER_ONLY",
"NO_ATOMIC_64_SUPPORT",
"METAL_MAX_DEVICE_REGIONS=2",
"RPMSG_BUFFER_SIZE=2048"
"RPMSG_BUFFER_SIZE=512"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletionvariants/GIGA/defines.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,7 +53,7 @@
-DMETAL_MAX_DEVICE_REGIONS=2
-DNO_ATOMIC_64_SUPPORT
-DQSPI_NO_SAMPLE_SHIFT
-DRPMSG_BUFFER_SIZE=2048
-DRPMSG_BUFFER_SIZE=512
-DSTM32H747xx
-DTARGET_CORDIO
-DTARGET_CORTEX
Expand Down
2 changes: 1 addition & 1 deletionvariants/NICLA_VISION/conf/mbed_app.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,7 @@
"VIRTIO_DRIVER_ONLY",
"NO_ATOMIC_64_SUPPORT",
"METAL_MAX_DEVICE_REGIONS=2",
"RPMSG_BUFFER_SIZE=100"
"RPMSG_BUFFER_SIZE=512"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletionvariants/NICLA_VISION/defines.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,7 +54,7 @@
-DMETAL_MAX_DEVICE_REGIONS=2
-DNO_ATOMIC_64_SUPPORT
-DQSPI_NO_SAMPLE_SHIFT
-DRPMSG_BUFFER_SIZE=2048
-DRPMSG_BUFFER_SIZE=512
-DSTM32H747xx
-DT1oI2C
-DT1oI2C_UM11225
Expand Down
2 changes: 1 addition & 1 deletionvariants/OPTA/conf/mbed_app.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@
"VIRTIO_DRIVER_ONLY",
"NO_ATOMIC_64_SUPPORT",
"METAL_MAX_DEVICE_REGIONS=2",
"RPMSG_BUFFER_SIZE=2048"
"RPMSG_BUFFER_SIZE=512"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletionvariants/OPTA/defines.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,7 +53,7 @@
-DMETAL_MAX_DEVICE_REGIONS=2
-DNO_ATOMIC_64_SUPPORT
-DQSPI_NO_SAMPLE_SHIFT
-DRPMSG_BUFFER_SIZE=2048
-DRPMSG_BUFFER_SIZE=512
-DSTM32H747xx
-DTARGET_CORDIO
-DTARGET_CORTEX
Expand Down
2 changes: 1 addition & 1 deletionvariants/PORTENTA_H7_M7/conf/mbed_app.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,7 +22,7 @@
"VIRTIO_DRIVER_ONLY",
"NO_ATOMIC_64_SUPPORT",
"METAL_MAX_DEVICE_REGIONS=2",
"RPMSG_BUFFER_SIZE=2048",
"RPMSG_BUFFER_SIZE=512",
"LSE_STARTUP_TIMEOUT=200"
]
}
Expand Down
2 changes: 1 addition & 1 deletionvariants/PORTENTA_H7_M7/defines.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -55,7 +55,7 @@
-DMETAL_MAX_DEVICE_REGIONS=2
-DNO_ATOMIC_64_SUPPORT
-DQSPI_NO_SAMPLE_SHIFT
-DRPMSG_BUFFER_SIZE=2048
-DRPMSG_BUFFER_SIZE=512
-DSTM32H747xx
-DTARGET_CORDIO
-DTARGET_CORTEX
Expand Down
2 changes: 1 addition & 1 deletionvariants/PORTENTA_X8/conf/mbed_app.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@
"VIRTIO_DEVICE_ONLY",
"NO_ATOMIC_64_SUPPORT",
"METAL_MAX_DEVICE_REGIONS=2",
"RPMSG_BUFFER_SIZE=2048"
"RPMSG_BUFFER_SIZE=512"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletionvariants/PORTENTA_X8/defines.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@
-DMETAL_MAX_DEVICE_REGIONS=2
-DNO_ATOMIC_64_SUPPORT
-DNO_VTOR_RELOCATE
-DRPMSG_BUFFER_SIZE=2048
-DRPMSG_BUFFER_SIZE=512
-DSTM32H747xx
-DTARGET_CORTEX
-DTARGET_CORTEX_M
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp