cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP257 OpenAMP RPMsg – Endpoint not getting created

jumman_JHINGA
Senior III

Hi,

I’m working on STM32MP257F-DK (A35 + M33) using OpenAMP + RPMsg over IPCC and facing an issue with RPMsg endpoint creation on the M33 side.


Goal

Simple use case:

  • Linux (A35) sends "START" / "STOP"

  • M33 receives the message via RPMsg

  • M33 toggles an LED


What is working

  • M33 firmware builds and boots correctly using remoteproc

  • Resource table is detected

  • Virtio RPMsg is created on Linux

 

From Linux dmesg:

virtio_rpmsg_bus virtio0: rpmsg host is online
remoteproc remoteproc0: remote processor m33 is now up

So remoteproc and OpenAMP transport are working.


Problem

With the following M33 code, RPMsg endpoint is not getting created on Linux side:

int rpmsg_recv_callback(struct rpmsg_endpoint *ept,
                         void *data,
                         size_t len,
                         uint32_t src,
                         void *priv)
{
    if (len >= 5 && strncmp((char *)data, "START", 5) == 0)
    {
        led_run = 1;
    }
    else if (len >= 4 && strncmp((char *)data, "STOP", 4) == 0)
    {
        led_run = 0;
        HAL_GPIO_WritePin(GPIOZ, GPIO_PIN_0, GPIO_PIN_RESET);
    }

    return 0;
}

 struct rpmsg_device *rpmsg_dev;
// extern struct rpmsg_device *rpmsg_dev;
void OPENAMP_CreateEndpoint(void)
{
//    if (!rpmsg_dev)
//    {
//        /* OpenAMP not ready yet */
//    	loc_printf("OpenAMP not ready yet.\r\n");
//        return;
//    }
	int status;
	status =  rpmsg_create_ept(&rp_endpoint,
                     rpmsg_dev,
                     "rpmsg-led",
                     RPMSG_ADDR_ANY,
                     RPMSG_ADDR_ANY,
                     rpmsg_recv_callback,
                     NULL);
	if(status < 0){
		printf("End Point not created.\r\n");

		while(1){
			HAL_GPIO_TogglePin(GPIOZ, GPIO_PIN_0);
			          HAL_Delay(100);
		}
	}
}


/* USER CODE END 0 */

/**
  * @brief  The application entry point.
  * @retval int
  */
int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* IPCC initialisation */
  MX_IPCC1_Init();

  if(!IS_DEVELOPER_BOOT_MODE())
  {
    /*Corpo Sync Initialization*/
	  CoproSync_Init();
  }
  /* OpenAmp initialisation ---------------------------------*/
  MX_OPENAMP_Init(RPMSG_REMOTE, NULL);

  /* USER CODE BEGIN SysInit */

  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  /* USER CODE BEGIN 2 */
  OPENAMP_CreateEndpoint();
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
      OPENAMP_check_for_message();

      if (led_run)
      {
          HAL_GPIO_TogglePin(GPIOZ, GPIO_PIN_0);
          HAL_Delay(500);
      }
      else
      {
          HAL_Delay(10);
      }
  }
  /* USER CODE END 3 */
}

But:

rpmsg_create_ept() returns -1

Because of this:

  • Endpoint is not created on M33

  • Linux never sees or binds to the endpoint

  • No userspace RPMsg channel is available

  • M33 callback is never triggered


Linux side observation

/sys/class/rpmsg → only rpmsg_ctrl0
/dev → rpmsg0, rpmsg_ctrl0

 

  • No RPMsg data endpoint appears

  • /sys/class/rpmsg/rpmsg_ctrl0/new_endpoint → permission denied

  • /dev/ttyRPMSG* does not exist

Any guidance or reference example for STM32MP257 RPMsg endpoint creation on M33 would be very helpful.

Thanks.

 

0 REPLIES 0