On Sat, May 9, 2020 at 10:47 AM stee...@163.com <stee...@163.com> wrote:
>
> Thanks a lot
> I make it work
>
> But there is some other bugs
> First
> in file
> /incubator-nuttx/include/metal/cpu.h
> line 15    # include <metal/processor//cpu.h>  should be  # include 
> <metal/processor/cpu.h>
>
> Second
> There is no  "processor " directory under  /incubator-nuttx/include/metal
> I don't understand the rules  of makefile ,I just copy the directory  from 
> /incubator-nuttx/openamp/libmetal/lib/processor    under  
> /incubator-nuttx/include/metal
> and copy cpu.h and atomic.h  from   
> /incubator-nuttx/openamp/libmetal/lib/processor/arm  to    
> /incubator-nuttx/openamp/libmetal/lib/processor and it works.
> Perhaps this is a stupid way to do so ,forgive me .
>
> I examiming the code ,perhaps make a link is the right way.

We can't use the link here directly, because the header files need do
some process to remove the special marker, like @PROJECT_SYSTEM@:
/*
 * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

/*
 * @file mutex.h
 * @brief Mutex primitives for libmetal.
 */

#ifndef __METAL_MUTEX__H__
#define __METAL_MUTEX__H__

#ifdef __cplusplus
extern "C" {
#endif

/** \defgroup mutex Mutex Interfaces
 *  @{
 */

The snippet in openamp/libmetal.defs use sed to replace these mark
with the real value:
#include <metal/system/@PROJECT_SYSTEM@/mutex.h>


LIBMETAL_HDRS_SEDEXP := \
"s/@PROJECT_VER_MAJOR@/0/g; \
s/@PROJECT_VER_MINOR@/1/g; \
s/@PROJECT_VER_PATCH@/0/g; \
s/@PROJECT_VER@/0.1.0/g; \
s/@PROJECT_SYSTEM@/nuttx/g; \
s/@PROJECT_PROCESSOR@/$(LIBMETAL_ARCH)/g; \
s/@PROJECT_MACHINE@/$(CONFIG_ARCH_CHIP)/g; \
s/@PROJECT_SYSTEM_UPPER@/nuttx/g; \
s/@PROJECT_PROCESSOR_UPPER@/$(LIBMETAL_ARCH)/g; \
s/@PROJECT_MACHINE_UPPER@/$(CONFIG_ARCH_CHIP)/g; \
s/cmakedefine/undef/g"

libmetal.zip:
$(Q) wget https://github.com/OpenAMP/libmetal/archive/v$(VERSION).zip
-O libmetal.zip
$(Q) unzip -o libmetal.zip
$(Q) mv libmetal-$(VERSION) libmetal
$(Q) patch -p0 < 0001-nuttx-change-sched_kfree-to-metal_free_memory.patch

.libmetal_headers: libmetal.zip
$(eval headers := $(wildcard libmetal/lib/compiler/gcc/*.h))
$(eval headers += $(wildcard libmetal/lib/processor/$(LIBMETAL_ARCH)/*.h))
$(eval headers += $(wildcard libmetal/lib/system/nuttx/*.h))
$(eval headers += $(wildcard libmetal/lib/*.h))
$(foreach header,$(headers), \
$(eval hobj := $(patsubst
libmetal$(DELIM)lib$(DELIM)%,$(TOPDIR)$(DELIM)include$(DELIM)metal$(DELIM)%,$(header)))
\
$(shell if [ ! -d $(dir $(hobj)) ];then mkdir -p $(dir $(hobj)); fi) \
$(shell sed $(LIBMETAL_HDRS_SEDEXP) $(header) > $(hobj)) \

So you don't need do anything special action after apply my patch.
it's enough to run:
make distclean
./tools/configure.sh xxx:yyy
make

>
>
>
>
>
>
>
> stee...@163.com
>
> 发件人: Xiang Xiao
> 发送时间: 2020-05-08 17:21
> 收件人: dev@nuttx.apache.org
> 主题: RE: Hi,anybody build nuttx that use openamp on board STM32H747I-disco
> Please try this patch:
> https://github.com/apache/incubator-nuttx/pull/1003
> The openamp/libmetal.defs fail to handle arch other than x86-64 and risc-v 
> correctly.
>
> Thanks
> Xiang
>
> -----Original Message-----
> From: stee...@163.com <stee...@163.com>
> Sent: Friday, May 8, 2020 3:25 PM
> To: dev <dev@nuttx.apache.org>
> Subject: Hi,anybody build nuttx that use openamp on board STM32H747I-disco
>
> Hi
> Anybody build nuttx that use openamp on board stm32h747i-disco?
> I turn on the openamp opion ,but give errors like
>
> make[1]: Entering directory '/home/steelen/nuttx/nuttx/openamp'
> make[1]: *** No rule to make target 'libmetal/lib/system/nuttx/condition.c', 
> needed by '.depend'.  Stop.
> make[1]: Leaving directory '/home/steelen/nuttx/nuttx/openamp'
> tools/Makefile.unix:504: recipe for target 'pass2dep' failed
> make: *** [pass2dep] Error 2
>
> I also download the incubator-nuttx version , when make it download a lot 
> files and also erros
>
> make[1]: Entering directory '/home/steelen/nuttx/incubator-nuttx/openamp'
> In file included from 
> /home/steelen/nuttx/incubator-nuttx/include/metal/io.h:23:0,
>                  from 
> /home/steelen/nuttx/incubator-nuttx/include/metal/device.h:16,
>                  from ./libmetal/lib/system/nuttx/device.c:12:
> /home/steelen/nuttx/incubator-nuttx/include/metal/cpu.h:15:35: fatal error: 
> metal/processor//cpu.h: No such file or directory  # include 
> <metal/processor//cpu.h>
>                                    ^
> compilation terminated.
> ERROR: arm-none-eabi-gcc failed: 1
>        command: arm-none-eabi-gcc -M -fno-builtin -Wall -Wstrict-prototypes 
> -Wshadow -Wundef -g -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard 
> -I. -isystem /home/steelen/nuttx/incubator-nuttx/include -D__KERNEL__ -pipe 
> -DMETAL_INTERNAL ./libmetal/lib/system/nuttx/device.c
> Makefile:72: recipe for target '.depend' failed
> make[1]: *** [.depend] Error 1
> make[1]: Leaving directory '/home/steelen/nuttx/incubator-nuttx/openamp'
> tools/Makefile.unix:498: recipe for target 'pass2dep' failed
> make: *** [pass2dep] Error 2
>
> I modify   # include <metal/processor//cpu.h>  to  # include 
> <metal/processor/cpu.h>
> also  erros
>
>
>
>
>
> stee...@163.com

Reply via email to