Skip to content

Commit a096bd6

Browse files
iabdalkaderfacchinm
authored andcommitted
libraries/RPC: Refactor and fix RPC library.
- Fix the memory corruption caused by the wrong MPU region configuration, which enabled caching of the shared memory region, without any cache maintenance in libmetal. - Fix the MPU region's TEX level, which was setting the shared memory region as a device and/or strongly-ordered memory, which caused usage faults on unaligned accesses. - Fix a deadlock that occurs if the main thread (sketch) makes a remote call and holds the virtqueue's mutex, and then gets preempted by the event thread, which in turn tries to acquire the same mutex. Note that libmetal's mutex implementation doesn't yield the CPU, it can be changed to do so, but for now the queues are protected with an OS mutex. - Fix RPCLIB msgpack unpacker memory overflow if RPMSG endpoint buffer > 512. - Optimize RPCLIB msgpack unpacker usage by allocating once and extending on demand. - Remove extra request/response threads, locking and callbacks, that were causing all sorts of concurrency issues, and were detrimental to performance. - Remove the redundant copy of messages to ring buffer, to boost the performance. - Remove many smaller dynamic allocation to improve the performance. - Use a single endpoint for message packs requests/responses ("RPC"), and another one dedicated for raw (non-packed) data. - General refactoring and cleanups, removal of dead code and variables, debugging code, etc... Signed-off-by: iabdalkader <[email protected]>
1 parent 3ab1a73 commit a096bd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: libraries/RPC/src/RPC.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,4 @@ size_t RPCClass::write(const uint8_t *buf, size_t len, bool raw) {
254254
OPENAMP_send(&endpoints[raw ? ENDPOINT_ID_RAW : ENDPOINT_ID_RPC], buf, len);
255255
mutex.unlock();
256256
return len;
257-
}
257+
}

0 commit comments

Comments
 (0)