2022-02-07 01:46 AM
Hi,
I follow the tutorial "How to exchange data buffers with the coprocessor".
Unfortunately, my board doesn't run the tutorial directly.
I read the code "stm32_rpmsg_sdb.c","backend.c","main.c" and modified it slightly. Now M4 can receive the address sent by rpmsg-sdb, but when M4 writes directly to this address, it will enter"void HardFault_Handler(void)",also cannot read the correct data.
I modified the code of "stm32_rpmsg_sdb.c" to test whether the applied memory can be used. After successfully applying for memory, data was written and correctly read in app, indicating that memory allocation and mapping should have been successful.
Can M4 read and write the memory allocated from rpMSG-sdb directly?
Or can you only use DMA to copy M4 memory into the requested memory?
Thanks in advance.
Solved! Go to Solution.
2022-02-08 08:00 AM
Hello @毅 黄 ,
When you say "and modified it slightly.", Can I know what are your changes?
Because the code must work directly without modifying the source code.
Normally the only things to update are:
You can see examples in the DTS provided with the LogicAnalyser.
To answer your question, theoretically, it can be possible to access directly to the memory allocated from rpmsg-sdb by using the M4, but it is not recommended. You have to be sure that M4 can access to the DDR area by looking at the ETZPC configuration in your TF-a DT.
If you read directly with M4, you will have:
That's why it is recommended to use the DMA to access to this memory.
Regards,
Kévin
2022-02-08 08:00 AM
Hello @毅 黄 ,
When you say "and modified it slightly.", Can I know what are your changes?
Because the code must work directly without modifying the source code.
Normally the only things to update are:
You can see examples in the DTS provided with the LogicAnalyser.
To answer your question, theoretically, it can be possible to access directly to the memory allocated from rpmsg-sdb by using the M4, but it is not recommended. You have to be sure that M4 can access to the DDR area by looking at the ETZPC configuration in your TF-a DT.
If you read directly with M4, you will have:
That's why it is recommended to use the DMA to access to this memory.
Regards,
Kévin
2022-02-17 08:11 AM
Hello @Kevin HUBER
2022-02-17 08:12 AM
Hello @Kevin HUBER
Thank you for your reply
My board does not have LCD, so I cannot run the program "How to Exchange data Buffers with the Coprocessor "directly, so I need to modify part of the code.
At present, A7 has actually transferred the address to M4, and the data received by SPI in M4 has been written into DDR through DMA, which can meet my requirements.
After I tried to modify the device tree of TF-A, I still could not read and write DDR directly. Thank you for telling me about the disadvantages of reading and writing DDR directly, maybe using DMA is the best way for me.
Thank you again for