2023-03-28 11:58 PM
Hi Guys,
So this is with a TouchGfx Cube v6.7.0 generated project with FW 1.11.0
I have added OpenAmp via Cube and based the code I am adding on the old PingPong example.
The following line fails with -2005 (RPMSG_ERR_BUFF_SIZE):
int32_t status = OPENAMP_create_endpoint(&rp_endpoint, RPMSG_SERVICE_NAME, RPMSG_ADDR_ANY, rpmsg_recv_callback, NULL);
This is due to the metal_io_region being incorrect, physmap as far as I can see should be 0 but it is 939525120 (0x38000400).
This first image is the values in the working PingPong example:
The second image is in the non working code:
This can be tracked down to OPENAMP_shmem_init() in openamp.c.
In the working PingPong example openamp.c is from 2019 and we have:
static metal_phys_addr_t shm_physmap[] = { 0 };
.
.
.
metal_io_init(&device->regions[0], (void *)SHM_START_ADDRESS, shm_physmap,
SHM_SIZE, -1U, 0, NULL);
shm_io = metal_device_io_region(device, 0);
The openamp.c from the cube project is from 2023 and in there we have:
static metal_phys_addr_t shm_physmap;
.
.
.
shm_physmap = SHM_START_ADDRESS;
metal_io_init(&device->regions[0], (void *)SHM_START_ADDRESS, &shm_physmap,
SHM_SIZE, -1, 0, NULL);
/* USER CODE BEGIN PRE_SHM_IO_INIT */
/* USER CODE END PRE_SHM_IO_INIT */
shm_io = metal_device_io_region(device, 0);
That code to me looks wrong, if I change the code to:
shm_physmap = 0;
metal_io_init(&device->regions[0], (void *)SHM_START_ADDRESS, &shm_physmap,
SHM_SIZE, -1, 0, NULL);
/* USER CODE BEGIN PRE_SHM_IO_INIT */
/* USER CODE END PRE_SHM_IO_INIT */
shm_io = metal_device_io_region(device, 0);
Now everything works, the call to OPENAMP_create_endpoint() now works.
I also have some other issues I am investigating that I will report here.
2023-03-29 07:20 AM
Hello @ACapo.1,
Would you please specify the STM32 product?
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.
2023-03-29 07:51 AM
Hi @F.Belaid
STM32H747XI on a STM32H747I-DISCO
Cheers
Andy
2023-03-30 05:38 AM
Hello @ACapo.1
Could you please, provide more details about your software configuration. I guess you generated the code with CubeMX v6.7.0. Do you confirm the same issue with the latest version v6.8.0? If yes, could you please share your IOC file?
The test works for me on an STM32H747I-DISCO using the Cube firmware example as it is.
Thank you for your contribution.
Firas
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.
2023-03-30 05:48 AM
2023-03-31 03:34 AM
Hi @ACapo.1,
I tried to execute the example provided with openamp.c from 2023 and it worked.
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.
2023-03-31 03:58 AM
Hi @F.Belaid
Can you please attach the openamp.c 2013 that you have here?
2023-03-31 04:06 AM
2023-03-31 04:15 AM
Thanks @F.Belaid
Looks the same, If I get some time early next week I will try the new openocd stuff with the example as you have to see if there is any difference here.
2023-04-13 02:49 AM
Have you found the solution?