cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157-DK2: Problem with UART7 when used with OPENAMP framework.

USama1
Associate II

We are a connecting a sensor to M4 side and reading the data through UART7. UART7 is enabled for M4 by modifying the Linux Kernel Device tree and TF-A .dtsi files.

Device tree file for TF-A is generated through STM32CubeMX. and Placed the generated files in the /fdts folder of TF-A(Which was downloaded from stm git) and built it and loaded to the board using the given procedure.

We are able to read the UART data correctly when OPENAMP_Init() is not used.

This is blocker for our project and urgent help would be appreciated.

Thank you.

21 REPLIES 21
Olivier GALLIEN
ST Employee

Hi @USama​ 

For efficient support would you be ok to share dts files and M4 project source code ?

You can send it to me with a private message if you prefer.

Else please give us some insight about your application :

What HAL you use to manage the UART ?

Are you using printf redirection ?

Does the communication A7/M4 working when OpenAMP_Init() is done ?

Thanks

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.
USama1
Associate II

Hi @Community member​ ,

I have sent the source code.

Both the OpenAMP and UART are working individually but not working when used in the same program. and We are not using any printf redirection. To manage UART, we are using the source generated with CubeMX.

Thank you.

Best Regards,

Upendar

Olivier GALLIEN
ST Employee

Hi @USama​ 

Thanks, got your project.

First assumption would be you may stay stuck in OpenAMP_init ()

Could you please better describe behavior when OpenAMP_Init() is there.

Complete application hang or application runs fine but just UART7 stuck ?

Did you try step by step debug on M4 ?

Else some traces on Linux side can be good to verify this assumption.

Please enable following dynamic trace :

echo -n 'file stm32_rproc.c +p' > /sys/kernel/debug/dynamic_debug/control

echo -n 'file stm32-ipcc.c +p' > /sys/kernel/debug/dynamic_debug/control

echo -n 'file remoteproc*.c +p' > /sys/kernel/debug/dynamic_debug/control

echo -n 'file virtio_rpmsg_bus.c +p' > /sys/kernel/debug/dynamic_debug/control

echo -n 'file virtio_ring.c +p' > /sys/kernel/debug/dynamic_debug/control

And share dmesg content after M4 firwmware start.

Thanks

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.

Hi @Community member​ ,

When I use OpenAMP_Init(), I am not getting proper data through UART7. I was able to read the header information with RP Lidar without OpenAMP_Init() but with it, I only get 0's.

I tried debugging but couldn;t understand much of OpenAMP code.

I will try dynmaic tracing from Linux side.

Thank you.

Best Regards,

Upendar Reddy

Olivier GALLIEN
ST Employee

Hi @USama​ 

Reading your code didn't trig any evidence about your issue.

One assumption would be an overlap of stack on the ipcc area.

Can you try to extend _Min_Stack_Size in .ld file ?

When you said you get 0 in case of OpenAMP, where did you get it ?

On Linux user side after sendmessageToA7 ?

Or right after getDeviceInfo ? ( breaking you m4 code and reading )

It may be useful to use the rproc trace to instrument your code. ( log.h/log.c lib)

Please enable it adding __LOG_TRACE_IO_ as precompile variable.

Then use printf or log_info at key steps in your code.

You can refer to Cube package example OpenAMP_TTY_echo for a reference code using it.

Hope it help,

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.

Forgot to mention that you can also remove all code related to VIRT_UART1 as it seems you do not use 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.

When you said you get 0 in case of OpenAMP, where did you get it ?

On Linux user side after sendmessageToA7 ?

Or right after getDeviceInfo ? ( breaking you m4 code and reading )

I am getting 0s while reading the UART7. The idea is to read data from UART and send it to A7.

Best Regards,

Upendar

Hi @Community member​ ,

I have a question. What do you mean by

First assumption would be you may stay stuck in OpenAMP_init ().

Is the stack for ipcc connection between UART7 and OpenAMP?

I have increated the stack size from 400 to 800, But still same problem persists.

I have attached the dmesg content after M4 firmware startup.

Best Regards,

Upendar S