MCC library For FreeRtos

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCC library For FreeRtos

2,090 Views
niranjanbc
Contributor IV

Hi i am looking for MCC library in FreeRtos

can you please provide the link for the same.

currently we have used MCC between A9(linux) and M4(MQX)

but we are planning to replace MQX with FreeRtos, but i dont find example code or MCC library for FreeRtos.

 

thanks

Niranjan

5 Replies

1,463 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Niranjan,

FreeRTOS have RPMSG instead of MCC, but it also use shared memory.

You can find a document explaining how to run RPMsg examples

Running RPMsg Demo Applications for Multicore Communication with IMX6SX and IMX7D 

You can see also some discussions about this topic here:

How does M4 and A9 on i.mx6sx access DDR 

MCC for FreeRTOS 


Best regards,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,463 Views
niranjanbc
Contributor IV

Hi Carlos

 

i am working on multiple endpoint RPMSG, i was able to modify the shared memory and use DDR.

but if I change/increase the  "RPMSG_BUF_SIZE" multiple endpoint wont work, channel wont get created by installing the module.

 

insmod /lib/modules/3.14.28-1.0.0_ga+g91cf351/kernel/drivers/rpmsg/rpmsg_multiept.ko

 

i have attached source file for rpmsg_multiept.ko

 

below please find the my code of imx_rpmsg.c

 

 

+ * For now, allocate 256 buffers of 512 bytes for each side. each buffer
+ * will then have 16B for the msg header and 496B for the payload.
+ * This will require a total space of 256KB for the buffers themselves, and
+ * 3 pages for every vring (the size of the vring depends on the number of
+ * buffers it supports).
+ */
+#define RPMSG_NUM_BUFS        (1024)
+#define RPMSG_BUF_SIZE        (512)
+#define RPMSG_BUFS_SPACE    (RPMSG_NUM_BUFS * RPMSG_BUF_SIZE)
+

+

+

 

.........

...........

 

MODULE_DEVICE_TABLE(of, imx_rpmsg_dt_ids);
+
+static int imx_rpmsg_probe(struct platform_device *pdev)
+{
+    int i, ret = 0;
+    struct device_node *np = pdev->dev.of_node;
+
+    for (i = 0; i < ARRAY_SIZE(imx_rpmsg_vprocs); i++) {
+        struct imx_rpmsg_vproc *rpdev = &imx_rpmsg_vprocs[i];
+
+        if (!strcmp(rpdev->rproc_name, "m4")) {
+            ret = of_device_is_compatible(np, "fsl,imx7d-rpmsg");
+            ret |= of_device_is_compatible(np, "fsl,imx6sx-rpmsg");
+            if (ret) {
+                /* hardcodes here now. */
+                rpdev->vring[0] = 0xBF800000; 
+                rpdev->vring[1] = 0xBF880000;
+            }
+        } else {
+            break;
+        }
+
+        pr_debug("%s rpdev%d: vring0 0x%x, vring1 0x%x\n", __func__,
+                i, rpdev->vring[0], rpdev->vring[1]);

 

 

 

if i change RPMSG_NUM_BUFS    back to  (512),  channel gets created.

am i doing calculation wrong.

how to calculate vring address.

i want to increase the number of buffers, what other changes i have to make that work.

if change the buffer number back to 512, i see rpmsg driver works fine.with above memory allocation.

i have allocated now last 8MB of shared DDR  memory for RPMSG.

do i need to change "RPMSG_VRING_ALIGN", what is the value and how to calculate it.

if i change RPMSG_VRING_ALIGN, what other files are affected, what other changes i have to make.

0 Kudos

1,463 Views
PetrL
NXP Employee
NXP Employee

Hi Niranjan,

we have prepared multiple endpoinds implementation. You can find reference here:

GitHub - NXPmicro/rpmsg-sysfs: Linux sysfs interface for RPMsg 

Regards,

PetrL

0 Kudos

1,463 Views
niranjanbc
Contributor IV

Thanks Petrl

i am using the above link reference code only in my project.

it is not working when i increase the number of buffers.

0 Kudos

1,463 Views
niranjanbc
Contributor IV

Thank you very much Carlos

0 Kudos