Hi Erwan, Arnaud, et all
I am using the Open-AMP ping pong example available in STM32CubeMX/IDE on a STM32H7 SoC. The example (not sure if it it is the same version) is at https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM3…
It is a Bare-metal example. I am trying find out which example in Zephyr can interface with this example. Currently I am using https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/ipc/o… since it uses resource table as in the PingPong Bare-metal example. But as you know the open-amp package used in Zephyr side is very new (I am using Zephyr 3.4.0). I have made couple of changes listed below to work with the PingPong example
1. resource_table in linker file to use the SRAM4 on STM32H7 SoC that I am using
2. I had to define CONFIG_RAM_CONSOLE=y since without it, the shared memory resource table offsets are different as seen by the Bare-metal side.
3. The PingPong application is using name service. So I have updated Zephyr side to use name service.
4. Remove tty application. Modify the Client application to receive a 4 byte data, increment and send it back to Master
With these changes, I can see the NS message sent out by CM4 running Zephyr. But my CM7 Bare-metal application doesn't see the message.
So the first question is if Open-AMP/Shared memory structs are compatible? Other piece of information is Zephyr runs on CM4 and Bare-metal on CM7.
On my debug, I found that the vring struct in memory has len = 0 instead of 100. Not sure where that goes wrong. Still debugging
Hi Experts,
I have also posted this to zephyr dev mailing list and thought to add it here as well as it is related to OpenAMP.
I tried it in v3.4.x version of Zephyr before the final v3.4.0 release.
I am able to get the OpenAMP Bare-metal sample application work for core-to-core messaging using the STM32CubeIDE. We are using Zephyr in our project that interfaces with Bare-metal. The OpenAMP master runs on Bare-metal and it uses resource table. So I am working to enable the samples/subsys/openamp_rsc_table. I am able to build this sample for another STM32 board as
west -v build -p always -b stm32mp157c_dk2 samples/subsys/ipc/openamp_rsc_table
I have added the overlay and conf required to my project files and trying to build the sample and get the below linker error. As my target is also M4 on STM32H755 SoC, I believe I am missing some change to allow the metal_io_read() to be resolved to a proper library function. Some has suggested using set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic") per https://github.com/alexa/avs-device-sdk/issues/1404
I have tried to add it to the lib/openamp CMakeLists.txt but didn't help. Since this sample builds fine for stm32mp157c_dk2 , some build flag missing for my STM32H755 SoC??? Any help on this will be appreciated.
Log here
[362/372] Linking CXX executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/xxxx/build/zephyr/zephyr_pre0.map
cmd.exe /C "cd . && C:\xxxx\zephyr-sdk-0.16.1\arm-zephyr-eabi\bin\arm-zephyr-eabi-g++.exe -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -fuse-ld=bfd -Wl,-T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=C:/xxxxx/zephyr/zephyr_pre0.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/lib/libc/common/liblib__libc__common.a zephyr/lib/posix/liblib__posix.a zephyr/subsys/fs/libsubsys__fs.a zephyr/subsys/random/libsubsys__random.a zephyr/subsys/sd/libsubsys__sd.a zephyr/subsys/net/libsubsys__net.a zephyr/subsys/net/ip/libsubsys__net__ip.a zephyr/subsys/net/lib/config/libsubsys__net__lib__config.a zephyr/drivers/disk/libdrivers__disk.a zephyr/drivers/interrupt_controller/libdrivers__interrupt_controller.a zephyr/drivers/clock_control/libdrivers__clock_control.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/ipm/libdrivers__ipm.a zephyr/drivers/pinctrl/libdrivers__pinctrl.a zephyr/drivers/reset/libdrivers__reset.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/timer/libdrivers__timer.a modules/stm32/stm32cube/lib..__modules__hal__stm32__stm32cube.a modules/libmetal/libmetal/lib/libmetal.a modules/littlefs/libmodules__littlefs.a modules/mbedtls/libmbedTLSBase.a modules/mbedtls/libmbedTLSCrypto.a modules/mbedtls/libmbedTLSX509.a modules/mbedtls/libmodules__mbedtls.a modules/open-amp/open-amp/lib/libopen_amp.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a -L"c:/users/murali.karicheri/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp" -LC:/xxxxx/build/zephyr -lgcc zephyr/arch/common/libisr_tables.a modules/mbedtls/libmbedTLSBase.a modules/mbedtls/libmbedTLSCrypto.a modules/mbedtls/libmbedTLSX509.a -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,--orphan-handling=warn -Wl,-no-pie && cmd.exe /C "cd /D C:\xxxx\build\zephyr && "C:\Program Files\CMake\bin\cmake.exe" -E echo ""
c:/xxxxx/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: modules/open-amp/open-amp/lib/libopen_amp.a(remoteproc_virtio.c.obj): in function `metal_io_read':
C:xxxxx/build/modules/libmetal/libmetal/lib/include/metal/io.h:252: undefined reference to `__atomic_load_8'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' --build 'C:\xxxx\build'
Branch: refs/heads/main
Home: https://github.com/OpenAMP/open-amp
Commit: 3882872bd5d89bbcd87ea3c5288a71882fde89de
https://github.com/OpenAMP/open-amp/commit/3882872bd5d89bbcd87ea3c5288a7188…
Author: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Date: 2023-09-18 (Mon, 18 Sep 2023)
Changed paths:
M cmake/options.cmake
Log Message:
-----------
options: fix typo
Fix typo for WITH_DCACHE_BUFFERS option.
Signed-off-by: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Commit: ca0747ebece056b50a50b67130a12b0e900a9f71
https://github.com/OpenAMP/open-amp/commit/ca0747ebece056b50a50b67130a12b0e…
Author: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Date: 2023-09-18 (Mon, 18 Sep 2023)
Changed paths:
M lib/include/openamp/virtqueue.h
M lib/virtio/virtqueue.c
Log Message:
-----------
virtqueue: move VRING_FLUSH and VRING_INVALIDATE to header
Move VRING_FLUSH and VRING_INVALIDATE defines to header file.
Signed-off-by: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Commit: 95a9038ca6598460d85c853d12b027b4e256dff2
https://github.com/OpenAMP/open-amp/commit/95a9038ca6598460d85c853d12b027b4…
Author: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Date: 2023-09-18 (Mon, 18 Sep 2023)
Changed paths:
M lib/include/openamp/rpmsg_virtio.h
M lib/rpmsg/rpmsg_virtio.c
Log Message:
-----------
rpmsg: buffers flush/invalidate
Do buffers flush and invalidate the same as with vrings
and resource table:
- add defines in header file;
- call BUFFER_FLUSH/BUFFER_INVALIDATE where necessary.
Signed-off-by: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Commit: b4f10fbb693fb5e573ad377bc17f95fcb6eebcab
https://github.com/OpenAMP/open-amp/commit/b4f10fbb693fb5e573ad377bc17f95fc…
Author: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Date: 2023-09-18 (Mon, 18 Sep 2023)
Changed paths:
M lib/include/openamp/remoteproc_virtio.h
M lib/include/openamp/rpmsg_virtio.h
M lib/include/openamp/virtqueue.h
M lib/virtio/virtqueue.c
Log Message:
-----------
virtqueue: define a common cache flush/invalidate
Since all cache operations, for vrings, buffer and
resource table are using metal_cache_flush and
metal_cache_invalidate, define a common function for all.
Signed-off-by: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Commit: f2162a69ac6764749a2e326d580921095c2527d9
https://github.com/OpenAMP/open-amp/commit/f2162a69ac6764749a2e326d58092109…
Author: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Date: 2023-09-18 (Mon, 18 Sep 2023)
Changed paths:
M README.md
M cmake/options.cmake
M lib/include/openamp/remoteproc_virtio.h
M lib/include/openamp/rpmsg_virtio.h
M lib/include/openamp/virtqueue.h
Log Message:
-----------
options: add option for all cache operations
Add WITH_DCACHE operation used for all cache operations:
vrings, buffers and resource table.
The other options will be deprecated - add warning
message for this.
Add info for WITH_DCACHE option in README.
Signed-off-by: Iuliana Prodan <iuliana.prodan(a)nxp.com>
Compare: https://github.com/OpenAMP/open-amp/compare/ca723b84185c...f2162a69ac67
Mathieu & Arnaud,
At first glance this seems like what we need to make the DMA API only
use buffers in a range we define.
https://lwn.net/ml/linux-kernel/20210106034124.30560-1-tientzu@chromium.org/
Bill
--
Bill Mills
Principal Technical Consultant, Linaro
+1-240-643-0836
TZ: US Eastern
Work Schedule: Tues/Wed/Thur
Branch: refs/heads/main
Home: https://github.com/OpenAMP/libmetal
Commit: 0ad1183a821bf3713dbb825887d86054d5458fa3
https://github.com/OpenAMP/libmetal/commit/0ad1183a821bf3713dbb825887d86054…
Author: Tanmay Shah <tanmay.shah(a)amd.com>
Date: 2023-09-11 (Mon, 11 Sep 2023)
Changed paths:
M lib/utilities.h
Log Message:
-----------
lib: utilities: add MB and GB defines
If MB and GB definition is not available then define new ones
Signed-off-by: Tanmay Shah <tanmay.shah(a)amd.com>
Branch: refs/heads/main
Home: https://github.com/OpenAMP/libmetal
Commit: 6d571fd068e1998a39a39c1d18d5ff10195274e9
https://github.com/OpenAMP/libmetal/commit/6d571fd068e1998a39a39c1d18d5ff10…
Author: Ben Levinsky <ben.levinsky(a)amd.com>
Date: 2023-09-11 (Mon, 11 Sep 2023)
Changed paths:
M lib/system/freertos/sys.h
Log Message:
-----------
lib: system: freertos: Add metal/errno.h to match standalone
As lib/system/generic/sys.h has metal/errno.h add this to the freertos
equivalent.
This fixes some compilation issues when linking against certain FreeRTOS port
BSPs.
Signed-off-by: Ben Levinsky <ben.levinsky(a)amd.com>