cancel
Showing results for 
Search instead for 
Did you mean: 

H7 FW 1.11.0 openamp broken? Problem with openamp.c from 2023

ACapo.1
Senior

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:0693W00000aPN5rQAG.png 

The second image is in the non working code:

0693W00000aPN5wQAG.png 

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.

13 REPLIES 13
FBL
ST Employee

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.


I'm out of offce with limited access to my emails.
Happy New Year!
ACapo.1
Senior

Hi @F.Belaid​ 

STM32H747XI on a STM32H747I-DISCO

Cheers

Andy

FBL
ST Employee

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.


I'm out of offce with limited access to my emails.
Happy New Year!
ACapo.1
Senior

Hi @F.Belaid​ , yep the example works as it is using openamp.c from 2019, openamp.c from 2023 doesn't work though.

Using CubeMX 6.7 or 6.8 is adding openamp.c from 2023.

The ioc is attached.

Thanks

Andy

FBL
ST Employee

Hi @ACapo.1​,

I tried to execute the example provided with openamp.c from 2023 and it worked.0693W00000bhHZCQA2.png

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.


I'm out of offce with limited access to my emails.
Happy New Year!
ACapo.1
Senior

Hi @F.Belaid​ 

Can you please attach the openamp.c 2013 that you have here?

FBL
ST Employee

I guess you mean openamp.c 2023,

Sure, here is the file generated with your ioc file.

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.


I'm out of offce with limited access to my emails.
Happy New Year!
ACapo.1
Senior

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.

Not applicable

Have you found the solution?