2019-06-26 09:54 AM
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.
2019-06-27 05:05 AM
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
2019-06-27 05:24 AM
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
2019-06-27 07:04 AM
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
2019-06-27 07:25 AM
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
2019-06-28 02:06 AM
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
2019-06-28 02:18 AM
Forgot to mention that you can also remove all code related to VIRT_UART1 as it seems you do not use it.
Olivier
2019-06-28 02:45 AM
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
2019-06-28 04:00 AM
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
2019-06-28 04:11 AM