cancel
Showing results for 
Search instead for 
Did you mean: 

Question regarding STM32MP157 ipcc implementation.

USama1
Associate II

I am using rpmsg and OpenAMP framework for ipcc implementaion.

I am trying to send some data from Cortex M4 to Cortex A7. Data array consists of integers of type uint16. But this transaction is happening properly. But when i use uint8, data is transferred properly. My question is, Is there any limitation on the data type in buffers? How can i send data of bigger data type to A7? Please help.

7 REPLIES 7
PatrickF
ST Employee

My understanding is that our provided examples for rpmsg and OpenAMP are based on virtual UART/tty, so transfer is byte oriented (see example on wiki).

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
USama1
Associate II

Yes. The examples are using uint8 array. But i am unable to send data more than 255. Is this a limitation on ipcc? This is important to our project. Please help. ​

PatrickF
ST Employee

There is no limitation in IPCC as data does not transit to it (only request). You should just increase the message buffer size (which is in SRAM).

see also this discussion https://community.st.com/s/question/0D50X0000AnuE1XSQU/what-is-the-maximum-transmission-interprocessor-bandwidth-on-stm32mp1

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

By default examples provided use RPMSG_BUFFER_SIZE set to 512.

Do you confirm issue above 255 ? If yes please share more details in order we can help. ( log, code etc. )

Thx,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

@Community member​ 

When i use below array, I could send data elements each from 0 to 255. These integers are received correct on A7 side.

uint8_t VirtUart1ChannelBuffTx[MAX_BUFFER_SIZE];

VIRT_UART_Transmit(&huart1, VirtUart1ChannelBuffRx, VirtUart1ChannelRxSize);

But when i use uint16, I am receiving truncated data on the A7 side. and some appendage of zeros also received after each entry in the array.

uint16_t VirtUart1ChannelBuffTx[MAX_BUFFER_SIZE];

VIRT_UART_Transmit(&huart1, VirtUart1ChannelBuffRx, VirtUart1ChannelRxSize);

And When you say RPMSG_BUFFER_SIZE set to 512, I can send 256 uint16 data elements through the buffers. isn't it?

and may be can you please let me know how can i send a pointer from M4 to A7. I mean how can i allocate memory in MCU SRAM on m4 side in the first place? I am bit new to this IPCC. Please help.

@PatrickF​ 

Hello,

I have identified the problem in my implementation and you are correct i need to increase the rpmsg buffer size. I tried to do that by modifying below data.

(virtio_rpmsg_bus.c) on Linux Side.

#define MAX_RPMSG_NUM_BUFS   (128)

#define MAX_RPMSG_BUF_SIZE   (2048)

and on M4 Side:

(rpmsg_virtio.h)

#ifndef RPMSG_BUFFER_SIZE

#define RPMSG_BUFFER_SIZE   (2048)

#endif

But after reloading the kernel, ttyRPMSG devices are not being created. I am getting following error.

Virtio_rpmsg_bus: probe of virtio0 failed with error -12.

Could you please help in resolving this error?

Olivier GALLIEN
ST Employee

Hi,

Noticed this thread never got answer.

>> Virtio_rpmsg_bus: probe of virtio0 failed with error -12.

Means linux fail to allocate the required shared memory.

Actually the memory budget require in shared memory for IPCC is computed from MAX_RPMSG_BUF_SIZ*2*VRING_NUM_BUFFS(as per defined in openamp_conf.h M4 side )

VRING_NUM_BUFFS is typically set to 16.

To multiply by 2 because of TX + RX.

So extended RPMSG buffer size to 2048 required to reserve at least 64KB in Device Tree node :

vdev0buffer: vdev0buffer@10044000 {

compatible = "shared-dma-pool";

reg = <0x10044000 0x10000>;

no-map;

};

Means the whole MCU SRAM3.

If needed you can eventually also use part of the MCU SRAM4.

(virtio_rpmsg_bus.c) on Linux Side.

#define MAX_RPMSG_NUM_BUFS   (128) -> this is just a max value with no impact on actual memory budget.

#define MAX_RPMSG_BUF_SIZE   (2048)

Hope it help,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.