cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32Mp15 Interprocess communication over OpenAmp doesent work

JJemm.1
Associate II

Hello, 

I am trying to establish an interprocessor communication between the cores A7 and M4 with the with the Stm32MP157. 

The example from ST "OpenAMP_TTY_echo" works fine, but as soon as I change the received buffer or try to send a costomize buffer from the M4 side, it is not received correctly by the A7 anymore.

0693W00000Y9x2yQAB.pngThis error happens even if I change only one character in the receive buffer.

Does anyone have a clue what is going wrong?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

HI @JJemm.1​ ,

The firmware package 1.4 looks quite old for me. You have to be sure that you are aligned with your OSTL version !

For example, if you work with OSTL 4.1 (or 4.0 anyway, = Linux 5.15), you must use the Cube FW Package v1.6 ! It is mandatory to have the 2 versions aligned because there is some dependencies for Coprocessor communication between both.

Kind regards,

Erwan.

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.

View solution in original post

5 REPLIES 5
Erwan SZYMANSKI
ST Employee

Hello @JJemm.1​ ,

Indeed, your issue looks really strange.

Can you share with me the M4 firmware code that you have modified to get this error ? I think something is going wrong somewhere with the modifications.

Kind regards,

Erwan.

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.
JJemm.1
Associate II

Hallo @ Erwan SZYMANSKI,

thank you for the reply. This was also my first thought, but I think that is not the case. As I have tried many variations and all have resulted in a similar error. 

The screenshot I posted was made with the sample code from STM32CubeMP1 FW Package v1.4.0 (https://github.com/STMicroelectronics/STM32CubeMP1/releases/tag/1.4.0 ) which I modified according to the description ( 9 Modify the firmware: https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-EV1/Develop_on_Arm®_Cortex®-M4/Modify,_rebuild_and_reload_a_firmware ).

I also tried the example from STM32CubeMP1 FW Package v1.6.0 and STM32CubeMP1 FW Package v1.2.0. With 1.6 no Rx callback was started and with 1.2 the Rx callback was started but no log_info(...) texts were output. With 1.4 both worked, so I continued with this version.

I can imagine that it is a driver problem but I cannot explain what exactly is wrong.

hier der von mir modifizierte Code vom Beispiel (Main loop)

  while (1)
  {
 
    OPENAMP_check_for_message();
 
    /* USER CODE END WHILE */
    if (VirtUart0RxMsg) {
      VirtUart0RxMsg = RESET;
      VIRT_UART_Transmit(&huart0, VirtUart0ChannelBuffRx, VirtUart0ChannelRxSize);
    }
 
    if (VirtUart1RxMsg) {
      VirtUart1RxMsg = RESET;
      char msg_to_transmit[MAX_BUFFER_SIZE];
      int msg_size = 0;
			
			msg_size = snprintf(msg_to_transmit, MAX_BUFFER_SIZE, "Channel RPMSG0: ");
      msg_size += snprintf(msg_to_transmit + msg_size, MAX_BUFFER_SIZE, "%s\n", VirtUart0ChannelBuffRx);
      log_info("size of the message to transmit = %d bytes\n", msg_size);
      VIRT_UART_Transmit(&huart1, (uint8_t*)msg_to_transmit, msg_size);
				
      VIRT_UART_Transmit(&huart1, VirtUart1ChannelBuffRx, VirtUart1ChannelRxSize);
    }
 
    if(counter++ == 500000) {
        BSP_LED_Toggle(LED7);
        counter = 0;
    }
 
    /* USER CODE BEGIN 3 */
  }

Rx-Callbacks

/* USER CODE BEGIN 4 */
void VIRT_UART0_RxCpltCallback(VIRT_UART_HandleTypeDef *huart)
{
 
    log_info("Msg received on VIRTUAL UART0 channel:  %s \n\r", (char *) huart->pRxBuffPtr);
 
    /* copy received msg in a variable to sent it back to master processor in main infinite loop*/
    VirtUart0ChannelRxSize = huart->RxXferSize < MAX_BUFFER_SIZE? huart->RxXferSize : MAX_BUFFER_SIZE-1;
    memcpy(VirtUart0ChannelBuffRx, huart->pRxBuffPtr, VirtUart0ChannelRxSize);
    VirtUart0RxMsg = SET;
}
 
void VIRT_UART1_RxCpltCallback(VIRT_UART_HandleTypeDef *huart)
{
 
    log_info("Msg received on VIRTUAL UART1 channel:  %s \n\r", (char *) huart->pRxBuffPtr);
 
    /* copy received msg in a variable to sent it back to master processor in main infinite loop*/
    VirtUart1ChannelRxSize = huart->RxXferSize < MAX_BUFFER_SIZE? huart->RxXferSize : MAX_BUFFER_SIZE-1;
    memcpy(VirtUart1ChannelBuffRx, huart->pRxBuffPtr, VirtUart1ChannelRxSize);
    VirtUart1RxMsg = SET;
}
/* USER CODE END 4 */

Best regards

Jemmo

HI @JJemm.1​ ,

The firmware package 1.4 looks quite old for me. You have to be sure that you are aligned with your OSTL version !

For example, if you work with OSTL 4.1 (or 4.0 anyway, = Linux 5.15), you must use the Cube FW Package v1.6 ! It is mandatory to have the 2 versions aligned because there is some dependencies for Coprocessor communication between both.

Kind regards,

Erwan.

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.
JJemm.1
Associate II

Hi @Erwan SZYMANSKI,

Thanks for the quick reply,

I have managed it in the meantime. It was a version problem as you assumed, but I'm not using the OSTL but a vendor YOCTO project . However, with the kernel version 5.10.74 I had the above-mentioned misbehaviour with 5.10.153 it seems to work even with the FW Package 1.6.

Best regards

Jemmo

Hello @JJemm.1​ ,

Thank you for your feedback.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

Kind regards,

Erwan

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.