-
Notifications
You must be signed in to change notification settings - Fork 245
[RPMSG] Adding Python transport layer for RPMsg sysfs kernel module #2
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
flit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the requested changes are made, it's ready to go! Thanks.
|
|
||
| import struct | ||
| import serial | ||
| from rpmsg.sysfs import RpmsgEndpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import will fail if the rpmsg package is not available. Please move it below the rest of the imports and wrap in a try-except statement. You can set a boolean variable to track whether RpmsgEndpoint is available, and use it in RpmsgTransport.
| class ConnectionClosed(Exception): | ||
| pass | ||
|
|
||
| class RpmsgTransport(Transport): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make RpmsgTransport a subclass of FramedTransport. This will allow you to avoid having to do an arbitrary 2048-byte receive. Instead, the FramedTransport will do fixed length receives of the 4-byte frame header followed by the known message length.
|
I have modified this pull request as the RPMsg Python wrapper has changed. Added try-except for import of RPMsg. 0001-RPMSG-Adding-Python-transport-layer-for-RPMsg-sysfs-.patch.zip |
|
can we possible make it installed by pip install? |
|
@hakehuang Yes, thanks for reminding me. I forgot to upload to pypi. |
|
Please provide patch aligned with latest eRPC code on develop branch. |
|
Closed, replaced by: |
…length This was spotted on a SAML21 controller: #0 usart_sync_read (io_descr=0x200006dc <USART_0>, buf=0x20000378 <s_msgFactory+8> , length=0) at ../hal/src/hal_usart_sync.c:271 EmbeddedRPC#1 0x000001e0 in io_read (io_descr=0x200006dc <USART_0>, buf=0x20000378 <s_msgFactory+8> , length=0) at ../hal/src/hal_io.c:62 EmbeddedRPC#2 0x0000e3da in erpc::UsartSyncTransport::underlyingReceive (this=0x20000578 <s_transport>, data=0x20000378 <s_msgFactory+8> , size=0) at ../erpc_usart_sync_transport.cpp:29 EmbeddedRPC#3 0x0000dd96 in erpc::FramedTransport::receive (this=0x20000578 <s_transport>, message=0x200026c4) at ../erpc_framed_transport.cpp:63 EmbeddedRPC#4 0x0000d7da in erpc::SimpleServer::runInternalBegin (this=0x20000340 <s_server>, codec=0x200026c0, buff=..., msgType=@0x200026bf: 32, serviceId=@0x200026b8: 536880832, methodId=@0x200026b4: 536871784, sequence=@0x200026b0: 536871784) at ../erpc_simple_server.cpp:64 EmbeddedRPC#5 0x0000d72a in erpc::SimpleServer::runInternal (this=0x20000340 <s_server>) at ../erpc_simple_server.cpp:42 EmbeddedRPC#6 0x0000d99e in erpc::SimpleServer::poll (this=0x20000340 <s_server>) at ../erpc_simple_server.cpp:223 EmbeddedRPC#7 0x0000d44e in erpc_server_poll () at ../erpc_server_setup.cpp:97 EmbeddedRPC#8 0x00006fa4 in main () at ../main.c:72 The UART need to be restarted to recover from a such error, for ex.: if (erpc_server_poll()) { usart_sync_disable(&USART_0); usart_sync_enable(&USART_0); }
- use PYTHON env. variable
…sport classes #2 Signed-off-by: Michal Princ (nxa17570) <michal.princ@nxp.com>
Merge in MCUCORE/mcux-sdk-erpc from feature/RPSDK-1294-erpc-enablement-for-zephyr to release/2.15.0_major_rfp * commit '8be06c079f8a18c5322a52e509d418056c6fcd3e': [RPSDK-1294] Newly added files clang formatting [RPSDK-1294] Formal changes [RPSDK-1294] Add Zephyr UART transport [RPSDK-1294] Update Zephyr threading [RPSDK-1294] Update Zephyr port
…plementation #2 Signed-off-by: Michal Princ (nxa17570) <michal.princ@nxp.com>
…gSend implementation #2" This reverts commit 746b672afa83bf9127d2827e4b763a701b451bdb.
rpmsg.zip
rpmsg_sysfs_interface.zip