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
ACapo.1
Senior

No I'm afraid not, I gave up on it.

ACapo.1
Senior

Hi John,

The IOC file is attached to one of the previous posts above.

I also tried saving updating to 6.8.

The code was produced by TouchGfx Designer.

I was just evaluating the idea of using an H7 and TouchGFX using a STM32H747I-DISCO board, as the recent boards have display issues with the BSP, I had no luck getting OpenAmp working and debugging both cores was a pain I binned the idea of using an H7 dual core.

Cheers

Andy

FBL
ST Employee

Hello @ACapo.1​ 

Still having issue with debugging OpenAmp? try this tutorial.

I'm trying to reproduce the behavior shared with another board. Could you give me hints on your TouchGFX configuration? Maybe, IOC file generated configuration that I couldn't see.

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.

urbito
Senior

Hello @FBL 

I am having the same/similar issue that @ACapo.1 is getting

i do have made a stand alone project that share an uint16_t array in an stm32h745 disco between both cores.

then i am porting it to an another board where i am actually working, this one have an stm32h755 and when initializing the touchgfx ->  MX_TouchGFX_Init(); it "crash" my communication. I am able to get the first message but not more messages after that one.

hope this info does help to you to point to where would may be the issue i am addressing this issue since few days ago, and i am thinking it is something related to LTDC/interrupts/priorities...

hope to hear from you soon! 

Edit: What i am trying to say is, there is something that makes an incompatibility having both TouchGFX and OpenAMP in the same project. For example, if i initialice the OpenAMP after the TouchGFX mentioned command, i cannot even get the endpoint answer from CM4.


Greetings!