Skip to main content
meiss.M
Associate III
October 28, 2019
Solved

No virtual UART device is generated & M4 gets stuck while initializing openamp

  • October 28, 2019
  • 10 replies
  • 5234 views

Hello,

previously, I had no problem setting up the virtual UARTs in the the Ac6 IDE using STM32CubeMX 5.3.0. With the new 5.4.0, the OpenAMP initialization change a bit so, obviously I enabled in the openamp_conf.h the UART HAL module driver (virt_uart.c).

 

With the generated code (Cube 5.4.0) the openamp initalization hangs the M4 when executing MX_OPENAMP_Init(). :

/* MCU Configuration--------------------------------------------------------*/
 
 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
 HAL_Init();
 
 /* USER CODE BEGIN Init */
	__HAL_RCC_HSEM_CLK_ENABLE();
 /* USER CODE END Init */
 
 /* Configure the system clock */
 SystemClock_Config();
 
 /* IPCC initialisation */
 MX_IPCC_Init();
 /* OpenAmp initialisation ---------------------------------*/
 MX_OPENAMP_Init(RPMSG_REMOTE, NULL);

What are the possibilities to debug this? I suspect, the CM4 cannot connect to the CA7. Thank you very much.

Thread #1 (Suspended : Signal : SIGINT:Interrupt)	
	metal_io_read() at io.h:223 0x10009a88	
	rproc_virtio_get_status() at remoteproc_virtio.c:66 0x10009c6e	
	rproc_virtio_wait_remote_ready() at remoteproc_virtio.c:326 0x10009f40	
	MX_OPENAMP_Init() at openamp.c:120 0x1000b7f6	
	main() at main.c:113 0x10000aa8	
	Reset_Handler() at startup_stm32mp157cacx.s:98 0x1000ccde

 

 

 

This topic has been closed for replies.
Best answer by Olivier GALLIEN

Hi @meiss.M​ , @lenonrt​ , @AShca.724​ , all

We have reproduced and analyzed your issues.

Actually there is several depending on your target and IDE.

For all :

A new function PeriphCommonClock_Config(); is generated and has to be commented or put under condition IS_ENGINEERING_BOOT_MODE() like SystemClock_Config();

If using CubeIDE :

You have to remove from project the file CM4/Core/Src/rsc_table.c

This bug will be fixed in next CubeIDE Version.

If using DK1 target :

You have to export in your project setting as compiler preprocessor the variable STM32MP157Cxx

This bug will be fixed in next Cube Package version

Apology for inconvenience,

Please confirm above work around fix all your issues.

BR,

Olivier

10 replies

nrg6
Associate II
October 29, 2019

I have the same problem with STM32CubeIDE 1.1.0. I created a project for the STM32MP157A-DK1 board with default settings. The M4 stucks while OPENAMP init in the function resource_table_init. I have 2.6-openstlinux-4.19-thud-mp1-19-10-09 running on the A7.

0690X00000ArNuNQAV.png

lenonrt
Associate III
October 29, 2019

I have exactly the same problem. Can't solve yet

lenonrt
Associate III
October 29, 2019

I see that have two diferent rsc_table.c files. One in the Core/Src folder and other in the OPENAMP folder. I don't know which one is used.

Olivier GALLIEN
Technical Moderator
October 29, 2019

Hi all,

Sorry for inconvenience. We will have a look at it .

Olivier

Olivier GALLIEN 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.
meiss.M
meiss.MAuthor
Associate III
October 29, 2019

Thank you for taking a look at it.

AShca.724
Visitor II
November 2, 2019

I have some problem.

Infinit loop:

while(resource_table.vring1.da != VRING_RX_ADDRESS)

Bumsik Kim
Senior
November 4, 2019

I didn't use CubeMX-generated code but the same thing happened in my case.

I fixed that by adding a proper IPCC interrupt handler.

I suggest you guys to double-check if the IPCC handler is added.

lenonrt
Associate III
November 4, 2019

Hi,

Can you show some code?

It's the interruptions in the "stm32mp1xx_it.c" file?

/**
 * @brief This function handles IPCC RX1 occupied interrupt.
 */
void IPCC_RX1_IRQHandler(void)
{
 /* USER CODE BEGIN IPCC_RX1_IRQn 0 */
 
 /* USER CODE END IPCC_RX1_IRQn 0 */
 HAL_IPCC_RX_IRQHandler(&hipcc);
 /* USER CODE BEGIN IPCC_RX1_IRQn 1 */
 
 /* USER CODE END IPCC_RX1_IRQn 1 */
}

Olivier GALLIEN
Olivier GALLIENBest answer
Technical Moderator
November 5, 2019

Hi @meiss.M​ , @lenonrt​ , @AShca.724​ , all

We have reproduced and analyzed your issues.

Actually there is several depending on your target and IDE.

For all :

A new function PeriphCommonClock_Config(); is generated and has to be commented or put under condition IS_ENGINEERING_BOOT_MODE() like SystemClock_Config();

If using CubeIDE :

You have to remove from project the file CM4/Core/Src/rsc_table.c

This bug will be fixed in next CubeIDE Version.

If using DK1 target :

You have to export in your project setting as compiler preprocessor the variable STM32MP157Cxx

This bug will be fixed in next Cube Package version

Apology for inconvenience,

Please confirm above work around fix all your issues.

BR,

Olivier

Olivier GALLIEN 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.
nrg6
Associate II
November 6, 2019

Hi Oliver,

this workaround works for me for a default project on DK1 target. I added RESMGR_UTILITY and USART3 and it is still working. But when i add FREERTOS and switch Timebase Source to TIM7, it ends up in HardFault_Handler. I have implemented CoproSync_ShutdownCb from the examples, but this has no effect.

I need a running soucecode base with OpenAMP, FreeRTOS and USART3.

lenonrt
Associate III
November 5, 2019

Hi @Community member​ !

That work solve my issues.

Thank you!

Lenon

meiss.M
meiss.MAuthor
Associate III
December 3, 2019

Thank you very much. In the meantime I also have managed to move to cubeIDE 1.1.0, and with the suggested modifications it now works. It would be nice to have the openamp code in the middleware directory separated from any ST code, so it is separated from the official code e.g. openamp on github.

The directory structure of the Cube 5.4 generated code for the A7 and M4 is nice.

Many greetings, Markus