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>
Hello All,
RPMsg in U-Boot is under development. First proof of concept patch v1 was sent to upstream mailing list as RFC patch here: http://patchwork.ozlabs.org/project/uboot/list/?series=365
Here is the video of demo of RPMsg framework introduced in above patch series:
https://www.youtube.com/watch?v=PxGNR_FYGt8
This document explains patch series and motivation to introduce RPMsg in U-Boot and future work that needs to be done: https://drive.google.com/file/d/1Bjtzj58klMPVuWEtRK89oyem7_Hdajn8/view?usp=…
This patch series is very basic implementation of virtio based RPMsg framework referenced from the Linux kernel. For now, U-Boot is communicating with remote processor over fix hard-coded endpoint. More advance features such as name-service, multiple endpoint support etc.. will be added in coming revisions of this patch series. Meanwhile, please feel free to review existing work and provide review comments and any other suggestions.
Thanks,
Tanmay
Hello All,
RPMsg in U-Boot is under development. First proof of concept patch v1
was sent to upstream mailing list as RFC patch here:
[1]http://patchwork.ozlabs.org/project/uboot/list/?series=365
Here is the video of demo of RPMsg framework introduced in above patch
series:
[2]https://www.youtube.com/watch?v=PxGNR_FYGt8
This document explains patch series and motivation to introduce RPMsg
in U-Boot and future work that needs to be done:
[3]https://drive.google.com/file/d/1Bjtzj58klMPVuWEtRK89oyem7_Hdajn8/vi
ew?usp=sharing
This patch series is very basic implementation of virtio based RPMsg
framework referenced from the Linux kernel. For now, U-Boot is
communicating with remote processor over fix hard-coded endpoint. More
advance features such as name-service, multiple endpoint support etc..
will be added in coming revisions of this patch series. Meanwhile,
please feel free to review existing work and provide review comments
and any other suggestions.
Thanks,
Tanmay
References
1. http://patchwork.ozlabs.org/project/uboot/list/?series=365
2. https://www.youtube.com/watch?v=PxGNR_FYGt8
3. https://drive.google.com/file/d/1Bjtzj58klMPVuWEtRK89oyem7_Hdajn8/view?usp=…
Branch: refs/heads/main
Home: https://github.com/OpenAMP/libmetal
Commit: 548f6428557acaa1ac218ab74b1e04b16f183f1c
https://github.com/OpenAMP/libmetal/commit/548f6428557acaa1ac218ab74b1e04b1…
Author: Sergei Korneichuk <sergei.korneichuk(a)amd.com>
Date: 2023-08-21 (Mon, 21 Aug 2023)
Changed paths:
M lib/atomic.h
Log Message:
-----------
Export each of the memory_order enumerators
The lib/atomic.h exports memory_order enum into the global namespace,
but none of its enumerators. According to Section 7.3.3 "The using
declaration" of the C++ standard: "specifying an enumeration name
in a using-declaration does not declare its enumerators in
the using-declaration's declarative region." See also:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0943r1.html
Signed-off-by: Sergei Korneichuk <sergei.korneichuk(a)amd.com>