- Notifications
You must be signed in to change notification settings - Fork1k
[MP1] Add RPMsg virtual serial protocol support (VirtIOSerial)#766
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
fpistm commentedNov 8, 2019
Great! |
kbumsik commentedNov 9, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
A workaround forOpenAMP/open-amp#182 has been added. Now |
25d4aae to601e343Comparefpistm commentedNov 15, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
If you talk about files copied in the core then yes they could be removed else ones in OpenAmp no to avoid any issue with OpenAMP update |
fpistm commentedNov 15, 2019
After a first quick review, here's my first feedback:
|
kbumsik commentedNov 15, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Do you mean splitting like other libraries such asSTM32duinoBLE? I know this library is very specific to the STM32MP1 series, but one of the main idea of the PR is to take over I hope that VirtIO would be considered as the same level as USB CDC.
Do you mean the default should be |
kbumsik commentedNov 16, 2019
Yes I'm talking especially about |
fpistm commentedNov 16, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
No, like a builtin library this is not the exactly the same.
Yes
So yes this could be cleaned |
fpistm commentedDec 11, 2019
@kbumsik |
kbumsik commentedDec 12, 2019
@fpistm Please take your time, the holiday is coming :) |
ABOSTM commentedJan 20, 2020
@arnopo FYI |
ABOSTM commentedJan 31, 2020
Hi@kbumsik, As I proposed some improvement, instead of making a review like usually, I propose a PR in your fork: In addition, I have few questions/remarks:
Why raising an error? why not allowing user to redefine this value ? Is it linked to definition in linux driver ?
If so, maybe you can add a comment before
|
fpistm commentedFeb 6, 2020
kbumsik commentedFeb 10, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I was just focused on other stuff until this week and now I can look into this PR again. For 1 and 4, this PR currently needs a little bit of cleanup after receiving feedbacks of the initial design, so I will do them after the design is confirmed. Also note that this PR is a redesign ofST's OpenAMP_TTY example. So there are some uncleaned traces from the example code yet. For 2,
yes. The Linux kernel specified the buffer size as 512. You can see this here:https://elixir.bootlin.com/linux/v5.5.2/source/drivers/rpmsg/virtio_rpmsg_bus.c#L137 It was also a guard to make sure the definition is not overritten by rpmsg_virtio.h. I was originally tried to use rpmsg_virtio.h for RPMSG_BUFFER_SIZE but including this header causes problems that comes from the included headers of rpmsg_virtio.h. So I created virtio_config.h and included a checker like this to make sure virtio_config.h is effective. I think it is fine to remove this guard to let developers to adjust the size, as long as the dev don't forget to increase the buffer in the Linux kernel as well. Maybe we can give For 3,
No, also replacing it by The design of the ring buffer is influenced bycdc-queue.h. The ring buffer is introduced to make the original ST's example code mentioned above more general-purpose, and it increases responsiveness of the Linux's synchronous rpmsg channel but not Arduino. Let's look at the diagram here, the virtio / rpmsg / OpenAMP is implemented using IPCC interrupts and shared memory (MCU SRAM3 region). Imagine A7 send a message to /dev/ttyRPMSG0. A7 sends a packet (max 512 bytes - 16 bytes header) to rvq virtqueue and trigger "new msg" interrupt. The message is stored in vring1 buffer which is associated with rvq. When copying vring1 to our Arduino virtio_buffer is done (thie is what The important thing is that A7's sending the message to /dev/ttyRPMSG0 is fully synchronous operation. The A7 process is blocked until it receives "buf free" interrupt. If M4 don't trigger it in timely manner the A7 process will be blocked indefinitely until it gets kernel timeout error in the worst case. So my idea is to increase virtio_buffer to I will look into your PR and will leave more feedbacks :) |
ABOSTM commentedFeb 10, 2020
Hi@kbumsik |
Uh oh!
There was an error while loading.Please reload this page.
This line originates from the CubeMP1 examples but it is consideredlegacy and can be removed.stm32duino#766 (comment)
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
arnopo commentedMar 11, 2020
Minors comments then LGTM |
kbumsik commentedMar 11, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Fixed 😛. Thanks for the review@arnopo 😉 |
kbumsik commentedMar 11, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@fpistm I made a mistake in the last commit "mbox_ipcc.c: rx_status_t -> mbox_status_t", which is fixed by the following fixup commit. However, the CI somehow passed the build of the failing commit. I guess the CI ignored board options. It should be fixed but I don't know how to locally test Github CI. What is the best way to locally debug the new CI? |
fpistm commentedMar 11, 2020
I will check. |
fpistm commentedMar 11, 2020
fpistm 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.
@kbumsik thanks again.
Just on last thing, please, could you do some cleanup in commits (squash,...)?
Thanks in advance.
kbumsik commentedMar 12, 2020
@fpistm Thanks for approval. Sure, I kept them unclean to preserve the history but it's time to squash. |
fpistm commentedMar 12, 2020
For sure 😉 |
2576a9d tod585e0bComparekbumsik commentedMar 15, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Well, it turns out to be it was a great idea to enable CI for VirtIOSerial. Edit: I excluded VirtIO from the failing lines in BareMinimum.ino. Seea6dcefe. Tell me if you want to do a different approach. |
2e2d3c3 toa6dcefeComparefpistm commentedMar 15, 2020
Right, that's why I've updated also the CI sketch else this would not be raised. Thanks for the update and the clean PR 👍 🥇 |
ABOSTM 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.
LGTM. Great job. Thanks
Uh oh!
There was an error while loading.Please reload this page.
Depends:
This PR currently includes commits from#717. Please look at commits with [VirtIO] title.As#717 is almost being merged I propose VirtIOSerial as promised.
VirtIOSerial.cpp is a virtual serial based onRPMsg messaging protocol, which is built on top ofVirtIO.
To clarify the terminologiesthe OpenAMP project standardizes RPMsg, VirtIO, and etc.
I named it VirtIOSerial because this is the most intuitive name for the most users. The code is based onOpenAMP_TTY_echo example from ST but it is heavily modified for Arduino Stream/Serial implementation.
The work is almost done and VirtIOSerial currently works well, but they are some minor issues needed to be addressed:
OPENAMP_log_dbg(),log_dbg()....)__ICCARM__,__CC_ARM) to reduce code noise?This is the updated version of README.md
I'm currently testing with the simple example code below:
You can compile & upload the script, and run
sh run_arduino.sh start. After that you can test it by running minicom:$ TERM=xterm minicom -D /dev/ttyRPMSG0Edit: there is a better Arduino Sketch to test:
This change is