RPMsg lite - Increase Data size transfer

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

RPMsg lite - Increase Data size transfer

Jump to solution
4,074 Views
malo_mabon
Contributor I

Hello,

We try to increase the data size transfer between the two cores on the LPCXpresso55S69 board using the "lpcxpresso55s69_rpmsg_lite_pingpong_cm33_core0" and "lpcxpresso55s69_rpmsg_lite_pingpong_cm33_core1" examples code.

Without any modification on RL_BUFFER_PAYLOAD_SIZE, we can send tables of 248 uint16_t (496 bytes). But it doesn't work when we increase the size of the table and we want to send tables 1024 uint16_t.

In order to send larger packets we made those changes :

  • in main_master.c and main_remote_master.c files:
typedef struct the_message
{
    uint16_t DATA[1024];   // Previous : uint32_t DATA;
} THE_MESSAGE, *THE_MESSAGE_PTR;​

and:

msg.DATA[0] // Before : msg.DATA
  • in rpmsg_config.h files:
#define RL_BUFFER_PAYLOAD_SIZE (2032U) // Before : (496U)​

It seems the link between the two cores doesn't launches.

Did we miss something?

Thanks in advance.

Best regards,

Malo

0 Kudos
1 Solution
3,905 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi Malo ,

You should also increase the shared memory buffer (on both remote and master projects), from my side 10KB was enough.

 

#define SH_MEM_TOTAL_SIZE (1024*10)

 

 

This was the suggestion of one of my colleagues. He also pointed out that the required shared memory total size should be :  4*(RL_BUFFER_PAYLOAD_SIZE+ 16) + additional space for housekeeping data (queues).

Doing the math for the shared memory size, with a payload of 2032, we can see that we require more than 8KB of shared memory. This explains why the example was not working , the default 6 KB of shared memory were not enough.

If you take the example and want to increase the shared memory buffer in the linker script configurations, you may face multiple linking errors, due to memory region overlaps. You should do this carefully

To overcome those errors quickly, I just allocated the rpmsg_lite_base in. BSS instead of the defined linker area for shared memory.

 

static char rpmsg_lite_base[SH_MEM_TOTAL_SIZE] __attribute__((section(".noinit.$rpmsg_sh_mem")));

 

That allow me to quickly test the environment for  2KB message transfer .However ,in your new project, you can allocate the shared memory and define RAM areas as you wish.

 

static char rpmsg_lite_base[SH_MEM_TOTAL_SIZE];

 

Another thing is that I must mention is that the example is limited to have a  message struct of the as large as the payload buffer  value.

 

#define RL_BUFFER_PAYLOAD_SIZE (2032U)

typedef struct the_message // size of 2032 bytes.
{
	uint8_t DATA;
	uint8_t buffer[2031];
} THE_MESSAGE, *THE_MESSAGE_PTR;

 

Here a bit  of the output console of the ping pong demo project from my side.

 

Primary core received a msg
Message: Size=7f0, DATA = 101// size of the buffer is 2032 bytes

RPMsg demo ends

 

I hope this helps,

My apologies for the delay,

Yours,

Diego.

 

Edit: grammar.

View solution in original post

0 Kudos
7 Replies
4,027 Views
malo_mabon
Contributor I

Hi Diego,

I try to make it work with a Payload buffer of 1008 bytes and it doesn't seems to work.

I change in rpmsg_config.h files :

#define RL_BUFFER_PAYLOAD_SIZE (1008U)

And in main.c files :

typedef struct the_message
{
uint16_t DATA[504];
} THE_MESSAGE, *THE_MESSAGE_PTR;

For my application I would like to send a buffer of 2048 bytes (1024 uint16_t) from the core0 to the core1 (the transfer in the other direction is not necessary) the quickest possible.

Thanks for your answer,

Malo

0 Kudos
4,033 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi Malo,

After checking the example on the LPC55S69 and the K32L2A6 (dual core with M4 and M0+) RPMsg ping pong examples.

My current test results indicat that a Payload buffer up to 1008 bytes is the maximum size to guarantee proper ping pong demos operation.  This implies that greater buffer sizes like 2038   are not currently supported by the demo examples.

#define RL_BUFFER_PAYLOAD_SIZE (1008U) //to perform 1Kb Msg transfer.

Could you let me know any other  detail regarding your application to see if I could provide further advice?

My apologies for the delayed reply

BR,

Diego.

0 Kudos
4,021 Views
malo_mabon
Contributor I

Okay I just successfully make it work with 1008 bytes transfer in ping-pong.

For my application I would like to send a buffer of 2048 bytes (1024 uint16_t) from the core0 to the core1 (the transfer in the other direction is not necessary) and the quickest possible. Do you have a solution ?

Thanks,

Malo

0 Kudos
3,906 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi Malo ,

You should also increase the shared memory buffer (on both remote and master projects), from my side 10KB was enough.

 

#define SH_MEM_TOTAL_SIZE (1024*10)

 

 

This was the suggestion of one of my colleagues. He also pointed out that the required shared memory total size should be :  4*(RL_BUFFER_PAYLOAD_SIZE+ 16) + additional space for housekeeping data (queues).

Doing the math for the shared memory size, with a payload of 2032, we can see that we require more than 8KB of shared memory. This explains why the example was not working , the default 6 KB of shared memory were not enough.

If you take the example and want to increase the shared memory buffer in the linker script configurations, you may face multiple linking errors, due to memory region overlaps. You should do this carefully

To overcome those errors quickly, I just allocated the rpmsg_lite_base in. BSS instead of the defined linker area for shared memory.

 

static char rpmsg_lite_base[SH_MEM_TOTAL_SIZE] __attribute__((section(".noinit.$rpmsg_sh_mem")));

 

That allow me to quickly test the environment for  2KB message transfer .However ,in your new project, you can allocate the shared memory and define RAM areas as you wish.

 

static char rpmsg_lite_base[SH_MEM_TOTAL_SIZE];

 

Another thing is that I must mention is that the example is limited to have a  message struct of the as large as the payload buffer  value.

 

#define RL_BUFFER_PAYLOAD_SIZE (2032U)

typedef struct the_message // size of 2032 bytes.
{
	uint8_t DATA;
	uint8_t buffer[2031];
} THE_MESSAGE, *THE_MESSAGE_PTR;

 

Here a bit  of the output console of the ping pong demo project from my side.

 

Primary core received a msg
Message: Size=7f0, DATA = 101// size of the buffer is 2032 bytes

RPMsg demo ends

 

I hope this helps,

My apologies for the delay,

Yours,

Diego.

 

Edit: grammar.

0 Kudos
3,329 Views
btclark1
Contributor I

Hello,

I am also needing to increase the RPMsg size.

I have changed RL_BUFFER_PAYLOAD_SIZE in rpmsg_config.h to 2032

However I cannot find "SH_MEM_TOTAL_SIZE in any file and also I cannot find main_master.c and main_remote_master.c  in the build.

I am using mcuxpresso_sdk_2.9.x-var01 (at https://github.com/varigit/freertos-variscite) on a VAR-SOM-MX8M-NANO which is a Cortex A53 running Linux and a Cortex M7 running FreeRTOS

Are these definitions in different files than listed here?

Thank you much for your help.

Brian

0 Kudos
3,313 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @btclark1 

I hope you are doing excellent!

In this case , could you help us to create a new post in the I.MX forum? This as because this case was closed already, and to avoid having information in to places. 

Best regards, 

Diego.

 

 

0 Kudos
3,867 Views
malo_mabon
Contributor I

Hello Diego,

It work ! Thank you very much !

Best regards,

Malo

0 Kudos