You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Sebastien Lorquet <se...@lorquet.fr> on 2021/05/20 09:46:51 UTC

external board build failure

Hello,

I have to update the nuttx in our project from pre-apache to last version.

We would like to use the external board feature.

As a test I copied the nucleo-f446re folder in boards/arm to somewhere 
else (sibling to apps and nuttx), renamed it, and pointed to it in the 
configuration. make menuconfig was happy with that.

However the build fails:

IN: fs/libfs.a -> staging/libfs.a
make[1]: Entering directory '/home/slo/nut/nuttx/binfmt'
CC:  binfmt_globals.c
CC:  binfmt_initialize.c
CC:  binfmt_register.c
CC:  binfmt_unregister.c
CC:  binfmt_loadmodule.c
CC:  binfmt_unloadmodule.c
CC:  binfmt_execmodule.c
CC:  binfmt_exec.c
CC:  binfmt_copyargv.c
CC:  binfmt_dumpmodule.c
CC:  builtin.c
AR (create): libbinfmt.a   binfmt_globals.o binfmt_initialize.o 
binfmt_register.o binfmt_unregister.o binfmt_loadmodule.o 
binfmt_unloadmodule.o binfmt_execmodule.o binfmt_exec.o 
binfmt_copyargv.o binfmt_dumpmodule.o builtin.o
make[1]: Leaving directory '/home/slo/nut/nuttx/binfmt'
IN: binfmt/libbinfmt.a -> staging/libbinfmt.a
make[1]: Entering directory '/home/slo/nut/nuttx/arch/arm/src'
make[2]: Entering directory '/home/slo/nut/my_own_nucleo/src'
make[2]: *** No rule to make target 'libboard.a'.  Stop.
make[2]: Leaving directory '/home/slo/nut/my_own_nucleo/src'
make[1]: *** [Makefile:152: board/libboard.a] Error 2
make[1]: Leaving directory '/home/slo/nut/nuttx/arch/arm/src'
make: *** [tools/Makefile.unix:422: nuttx] Error 2

Looks like a Makefile (or just a rule) is missing. Is it a bug in this 
board/arch or in my own method or a problem in the external board build 
system?

I'm using a relative board path.

I'll add a github issue when the problem is understood.

Sebastien


Re: external board build failure

Posted by Abdelatif Guettouche <ab...@gmail.com>.
There is this issue that has more details, as well:
https://github.com/apache/incubator-nuttx/issues/2206

On Thu, May 20, 2021 at 12:44 PM Abdelatif Guettouche
<ab...@gmail.com> wrote:
>
> Hi,
>
> Is it possible to share the defconfig?  I just tried with an old one
> (based on STM32) and I have a clean build.
> The relevant configs that need to be correctly set are:
> CONFIG_ARCH_BOARD_CUSTOM=y
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../boards/stm32/board-dir"
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> CONFIG_ARCH_BOARD_CUSTOM_NAME="Custom-STM32-Board"
>
> On Thu, May 20, 2021 at 10:47 AM Sebastien Lorquet <se...@lorquet.fr> wrote:
> >
> > Hello,
> >
> > I have to update the nuttx in our project from pre-apache to last version.
> >
> > We would like to use the external board feature.
> >
> > As a test I copied the nucleo-f446re folder in boards/arm to somewhere
> > else (sibling to apps and nuttx), renamed it, and pointed to it in the
> > configuration. make menuconfig was happy with that.
> >
> > However the build fails:
> >
> > IN: fs/libfs.a -> staging/libfs.a
> > make[1]: Entering directory '/home/slo/nut/nuttx/binfmt'
> > CC:  binfmt_globals.c
> > CC:  binfmt_initialize.c
> > CC:  binfmt_register.c
> > CC:  binfmt_unregister.c
> > CC:  binfmt_loadmodule.c
> > CC:  binfmt_unloadmodule.c
> > CC:  binfmt_execmodule.c
> > CC:  binfmt_exec.c
> > CC:  binfmt_copyargv.c
> > CC:  binfmt_dumpmodule.c
> > CC:  builtin.c
> > AR (create): libbinfmt.a   binfmt_globals.o binfmt_initialize.o
> > binfmt_register.o binfmt_unregister.o binfmt_loadmodule.o
> > binfmt_unloadmodule.o binfmt_execmodule.o binfmt_exec.o
> > binfmt_copyargv.o binfmt_dumpmodule.o builtin.o
> > make[1]: Leaving directory '/home/slo/nut/nuttx/binfmt'
> > IN: binfmt/libbinfmt.a -> staging/libbinfmt.a
> > make[1]: Entering directory '/home/slo/nut/nuttx/arch/arm/src'
> > make[2]: Entering directory '/home/slo/nut/my_own_nucleo/src'
> > make[2]: *** No rule to make target 'libboard.a'.  Stop.
> > make[2]: Leaving directory '/home/slo/nut/my_own_nucleo/src'
> > make[1]: *** [Makefile:152: board/libboard.a] Error 2
> > make[1]: Leaving directory '/home/slo/nut/nuttx/arch/arm/src'
> > make: *** [tools/Makefile.unix:422: nuttx] Error 2
> >
> > Looks like a Makefile (or just a rule) is missing. Is it a bug in this
> > board/arch or in my own method or a problem in the external board build
> > system?
> >
> > I'm using a relative board path.
> >
> > I'll add a github issue when the problem is understood.
> >
> > Sebastien
> >

Re: external board build failure (stm32 specific)

Posted by Sebastien Lorquet <se...@lorquet.fr>.
Thats because the stm32l4 boards dont have a common folder.

Same for stm32f7

The problem is specific to stm32 (f4 and others). But it's significant 
because it's one of the most used stm32 product families.

I guess the common folder should be avoided.

Sebastien

Le 20/05/2021 à 15:46, Daniel Pereira Carvalho a écrit :
> I've just tested the external board build following these simple steps.
>
> 1 - Clone nuttx and nuttx-apps on base dir
> 2 - Created a new dir called board
>      $ mkir board
>      $ cd board
> 3 - Copied nucleo-l432kc board directory
>      $  cp -r ../nuttx/boards/arm/stm32l4/nucleo-l432kc/ ./
> 4 - Configure nuttx to build the external board. From nuttx folder
>      $ ./tools/configure.sh ../board/nucleo-l432kc/configs/nsh/
> 5 - Build
>      $ make
>
> These steps seems to work fine for me.
>
> Thanks
>
> Daniel Pereira de Carvalho
>
>
> Em qui., 20 de mai. de 2021 às 10:35, Alan Carvalho de Assis <
> acassis@gmail.com> escreveu:
>
>> I agree, it should a good idea if it could be turned into a Documentation
>> page!
>>
>> BR,
>>
>> Alan
>>
>> On 5/20/21, Sebastien Lorquet <se...@lorquet.fr> wrote:
>>> :o
>>>
>>> it worked.
>>>
>>> How am I supposed to guess this?
>>>
>>> Your email should be copied verbatim in the official documentation
>>> somewhere under "how to create and build a custom board"
>>>
>>> Also I woud advise against this common dir in boards, since it prevents
>>> users from creating custom boards from built-in ones.
>>>
>>> Duplication is not always bad, as we know...
>>>
>>> Sebastien
>>>
>>>
>>> Le 20/05/2021 à 15:27, Abdelatif Guettouche a écrit :
>>>> Rename Make.defs to Makefile

Re: external board build failure

Posted by Daniel Pereira Carvalho <da...@gmail.com>.
I've just tested the external board build following these simple steps.

1 - Clone nuttx and nuttx-apps on base dir
2 - Created a new dir called board
    $ mkir board
    $ cd board
3 - Copied nucleo-l432kc board directory
    $  cp -r ../nuttx/boards/arm/stm32l4/nucleo-l432kc/ ./
4 - Configure nuttx to build the external board. From nuttx folder
    $ ./tools/configure.sh ../board/nucleo-l432kc/configs/nsh/
5 - Build
    $ make

These steps seems to work fine for me.

Thanks

Daniel Pereira de Carvalho


Em qui., 20 de mai. de 2021 às 10:35, Alan Carvalho de Assis <
acassis@gmail.com> escreveu:

> I agree, it should a good idea if it could be turned into a Documentation
> page!
>
> BR,
>
> Alan
>
> On 5/20/21, Sebastien Lorquet <se...@lorquet.fr> wrote:
> > :o
> >
> > it worked.
> >
> > How am I supposed to guess this?
> >
> > Your email should be copied verbatim in the official documentation
> > somewhere under "how to create and build a custom board"
> >
> > Also I woud advise against this common dir in boards, since it prevents
> > users from creating custom boards from built-in ones.
> >
> > Duplication is not always bad, as we know...
> >
> > Sebastien
> >
> >
> > Le 20/05/2021 à 15:27, Abdelatif Guettouche a écrit :
> >> Rename Make.defs to Makefile
> >
>

Re: external board build failure

Posted by Abdelatif Guettouche <ab...@gmail.com>.
> Also I woud advise against this common dir in boards, since it prevents
users from creating custom boards from built-in ones.

We can still create a custom board from an in-tree board that has the
common dir. We just have to either include the common dir or remove it
and adapt the makefiles as we did here.
I have something similar to this:
tree -L 2 boards/

|── board1
│   ├── configs
...
│   └── src
|── board2
│   ├── configs
...
│   └── src
└── stm32
    ├── common
    ├── drivers
    └── stm32-board1
    └── stm32-board2

I think the common dir just added an extra step (although, it's not too obvious)

> I've just tested the external board build following these simple steps.

These steps will work because STM32L4 family doesn't have a common
directory.  This is the "old" method that Sebastien was referring to.

In any case, I think we can write a script that can create a custom
board based on an in-tree board, regardless of the presence or not of
the common directory.

On Thu, May 20, 2021 at 2:35 PM Alan Carvalho de Assis
<ac...@gmail.com> wrote:
>
> I agree, it should a good idea if it could be turned into a Documentation page!
>
> BR,
>
> Alan
>
> On 5/20/21, Sebastien Lorquet <se...@lorquet.fr> wrote:
> > :o
> >
> > it worked.
> >
> > How am I supposed to guess this?
> >
> > Your email should be copied verbatim in the official documentation
> > somewhere under "how to create and build a custom board"
> >
> > Also I woud advise against this common dir in boards, since it prevents
> > users from creating custom boards from built-in ones.
> >
> > Duplication is not always bad, as we know...
> >
> > Sebastien
> >
> >
> > Le 20/05/2021 à 15:27, Abdelatif Guettouche a écrit :
> >> Rename Make.defs to Makefile
> >

Re: external board build failure

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
I agree, it should a good idea if it could be turned into a Documentation page!

BR,

Alan

On 5/20/21, Sebastien Lorquet <se...@lorquet.fr> wrote:
> :o
>
> it worked.
>
> How am I supposed to guess this?
>
> Your email should be copied verbatim in the official documentation
> somewhere under "how to create and build a custom board"
>
> Also I woud advise against this common dir in boards, since it prevents
> users from creating custom boards from built-in ones.
>
> Duplication is not always bad, as we know...
>
> Sebastien
>
>
> Le 20/05/2021 à 15:27, Abdelatif Guettouche a écrit :
>> Rename Make.defs to Makefile
>

Re: external board build failure

Posted by Sebastien Lorquet <se...@lorquet.fr>.
:o

it worked.

How am I supposed to guess this?

Your email should be copied verbatim in the official documentation 
somewhere under "how to create and build a custom board"

Also I woud advise against this common dir in boards, since it prevents 
users from creating custom boards from built-in ones.

Duplication is not always bad, as we know...

Sebastien


Le 20/05/2021 à 15:27, Abdelatif Guettouche a écrit :
> Rename Make.defs to Makefile

Re: external board build failure

Posted by Abdelatif Guettouche <ab...@gmail.com>.
> Rename Make.defs to Makefile

To be clear, here I'm referring to ../boards/nucleo-f446re/src/Make.defs

On Thu, May 20, 2021 at 2:27 PM Abdelatif Guettouche
<ab...@gmail.com> wrote:
>
> I just copied the nucleo-fe446re board without the common directory.
>
> Here are the steps I took:
> Add the correct custom board CONFIGs to nsh/defconfig (and remove some
> of the old ones)
> Rename Make.defs to Makefile
> Add include $(TOPDIR)/boards/Board.mk to the end of the file.
>
> ./tools/configure.sh ../boards/nucleo-f446re/configs/nsh
> make
>
> Builds fine.
>
> On Thu, May 20, 2021 at 2:14 PM Abdelatif Guettouche
> <ab...@gmail.com> wrote:
> >
> > (It looks like we dropped the list somehow, I'm bringing it back...)
> >
> > > There is no way this common file is going into my custom board.
> >
> > If you don't want it; just remove it.  But you'll have to adapt your
> > Make.defs file.  Mainly adding "include $(TOPDIR)/boards/Board.mk" at
> > the end.
> > Other small things could be required. Adapt it from a different board
> > that doesn't have a common directory, an STM32F7 for example, it will
> > be simpler.
> >
> >
> > On Thu, May 20, 2021 at 2:11 PM Sebastien Lorquet <se...@lorquet.fr> wrote:
> > >
> > > This entirely defeat the purpose of a custom board.
> > >
> > > There is no way this common file is going into my custom board.
> > >
> > > What to do? Do I need TWO custom dirs? One for the board and one for the
> > > custom stuff?
> > >
> > > Sebastien
> > >
> > > Le 20/05/2021 à 15:08, Abdelatif Guettouche a écrit :
> > > > It should then also be the same case as #2206, you'll need the common
> > > > directory: https://github.com/apache/incubator-nuttx/issues/2206#issuecomment-721141748
> > > >
> > > > For STM32 (and other chips that have the "common" directory
> > > > structure), the stm32/board_dir/src/Make.defs file is not complete.
> > > > It needs the stm32/common/Makefile in order to get everything hooked
> > > > into the build system.
> > > >
> > > > On Thu, May 20, 2021 at 2:01 PM Sebastien Lorquet <se...@lorquet.fr> wrote:
> > > >> It was the defconfig from nucleo-f446re:nsh, only modified to use a
> > > >> custom board with relpath.
> > > >>
> > > >> The same failure happens with the stm32f427i-disco:nsh configuration.
> > > >>
> > > >>
> > > >> I have the same issues as described in 2206
> > > >>
> > > >> I have tried running: tools/configure.sh ../my_own_nucleo/configs/nsh
> > > >>
> > > >> And the log shows:
> > > >>
> > > >> LN: include/arch to arch/arm/include
> > > >> LN: include/arch/board to /home/slo/nut/nuttx/boards/arm/stm32/nucleo-f446re/include
> > > >> LN: include/arch/chip to arch/arm/include/stm32
> > > >> LN: arch/arm/src/board to /home/slo/nut/nuttx/boards/arm/stm32/nucleo-f446re/../common
> > > >> LN: arch/arm/src/board/board to /home/slo/nut/nuttx/boards/arm/stm32/nucleo-f446re/src
> > > >> LN: arch/arm/src/chip to arch/arm/src/stm32
> > > >> LN: /home/slo/nut/nuttx/drivers/platform to /home/slo/nut/nuttx/drivers/dummy
> > > >>
> > > >> and it builds, because it uses the original dev board
> > > >>
> > > >> So in fact using configure with a custom board path DOES NOT work. It just configures whatever built in board is indicated in the config file.
> > > >>
> > > >> Then I tried to change the board path using make menuconfig, then make again, and then it stops building as before: '*** No rule to make target 'libboard.a'.'
> > > >>
> > > >> Sebastien
> > > >>
> > > >>
> > > >> Le 20/05/2021 à 13:44, Abdelatif Guettouche a écrit :
> > > >>> Hi,
> > > >>>
> > > >>> Is it possible to share the defconfig?  I just tried with an old one
> > > >>> (based on STM32) and I have a clean build.
> > > >>> The relevant configs that need to be correctly set are:
> > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../boards/stm32/board-dir"
> > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="Custom-STM32-Board"
> > > >>>
> > > >>> On Thu, May 20, 2021 at 10:47 AM Sebastien Lorquet <se...@lorquet.fr> wrote:
> > > >>>> Hello,
> > > >>>>
> > > >>>> I have to update the nuttx in our project from pre-apache to last version.
> > > >>>>
> > > >>>> We would like to use the external board feature.
> > > >>>>
> > > >>>> As a test I copied the nucleo-f446re folder in boards/arm to somewhere
> > > >>>> else (sibling to apps and nuttx), renamed it, and pointed to it in the
> > > >>>> configuration. make menuconfig was happy with that.
> > > >>>>
> > > >>>> However the build fails:
> > > >>>>
> > > >>>> IN: fs/libfs.a -> staging/libfs.a
> > > >>>> make[1]: Entering directory '/home/slo/nut/nuttx/binfmt'
> > > >>>> CC:  binfmt_globals.c
> > > >>>> CC:  binfmt_initialize.c
> > > >>>> CC:  binfmt_register.c
> > > >>>> CC:  binfmt_unregister.c
> > > >>>> CC:  binfmt_loadmodule.c
> > > >>>> CC:  binfmt_unloadmodule.c
> > > >>>> CC:  binfmt_execmodule.c
> > > >>>> CC:  binfmt_exec.c
> > > >>>> CC:  binfmt_copyargv.c
> > > >>>> CC:  binfmt_dumpmodule.c
> > > >>>> CC:  builtin.c
> > > >>>> AR (create): libbinfmt.a   binfmt_globals.o binfmt_initialize.o
> > > >>>> binfmt_register.o binfmt_unregister.o binfmt_loadmodule.o
> > > >>>> binfmt_unloadmodule.o binfmt_execmodule.o binfmt_exec.o
> > > >>>> binfmt_copyargv.o binfmt_dumpmodule.o builtin.o
> > > >>>> make[1]: Leaving directory '/home/slo/nut/nuttx/binfmt'
> > > >>>> IN: binfmt/libbinfmt.a -> staging/libbinfmt.a
> > > >>>> make[1]: Entering directory '/home/slo/nut/nuttx/arch/arm/src'
> > > >>>> make[2]: Entering directory '/home/slo/nut/my_own_nucleo/src'
> > > >>>> make[2]: *** No rule to make target 'libboard.a'.  Stop.
> > > >>>> make[2]: Leaving directory '/home/slo/nut/my_own_nucleo/src'
> > > >>>> make[1]: *** [Makefile:152: board/libboard.a] Error 2
> > > >>>> make[1]: Leaving directory '/home/slo/nut/nuttx/arch/arm/src'
> > > >>>> make: *** [tools/Makefile.unix:422: nuttx] Error 2
> > > >>>>
> > > >>>> Looks like a Makefile (or just a rule) is missing. Is it a bug in this
> > > >>>> board/arch or in my own method or a problem in the external board build
> > > >>>> system?
> > > >>>>
> > > >>>> I'm using a relative board path.
> > > >>>>
> > > >>>> I'll add a github issue when the problem is understood.
> > > >>>>
> > > >>>> Sebastien
> > > >>>>

Re: external board build failure

Posted by Abdelatif Guettouche <ab...@gmail.com>.
I just copied the nucleo-fe446re board without the common directory.

Here are the steps I took:
Add the correct custom board CONFIGs to nsh/defconfig (and remove some
of the old ones)
Rename Make.defs to Makefile
Add include $(TOPDIR)/boards/Board.mk to the end of the file.

./tools/configure.sh ../boards/nucleo-f446re/configs/nsh
make

Builds fine.

On Thu, May 20, 2021 at 2:14 PM Abdelatif Guettouche
<ab...@gmail.com> wrote:
>
> (It looks like we dropped the list somehow, I'm bringing it back...)
>
> > There is no way this common file is going into my custom board.
>
> If you don't want it; just remove it.  But you'll have to adapt your
> Make.defs file.  Mainly adding "include $(TOPDIR)/boards/Board.mk" at
> the end.
> Other small things could be required. Adapt it from a different board
> that doesn't have a common directory, an STM32F7 for example, it will
> be simpler.
>
>
> On Thu, May 20, 2021 at 2:11 PM Sebastien Lorquet <se...@lorquet.fr> wrote:
> >
> > This entirely defeat the purpose of a custom board.
> >
> > There is no way this common file is going into my custom board.
> >
> > What to do? Do I need TWO custom dirs? One for the board and one for the
> > custom stuff?
> >
> > Sebastien
> >
> > Le 20/05/2021 à 15:08, Abdelatif Guettouche a écrit :
> > > It should then also be the same case as #2206, you'll need the common
> > > directory: https://github.com/apache/incubator-nuttx/issues/2206#issuecomment-721141748
> > >
> > > For STM32 (and other chips that have the "common" directory
> > > structure), the stm32/board_dir/src/Make.defs file is not complete.
> > > It needs the stm32/common/Makefile in order to get everything hooked
> > > into the build system.
> > >
> > > On Thu, May 20, 2021 at 2:01 PM Sebastien Lorquet <se...@lorquet.fr> wrote:
> > >> It was the defconfig from nucleo-f446re:nsh, only modified to use a
> > >> custom board with relpath.
> > >>
> > >> The same failure happens with the stm32f427i-disco:nsh configuration.
> > >>
> > >>
> > >> I have the same issues as described in 2206
> > >>
> > >> I have tried running: tools/configure.sh ../my_own_nucleo/configs/nsh
> > >>
> > >> And the log shows:
> > >>
> > >> LN: include/arch to arch/arm/include
> > >> LN: include/arch/board to /home/slo/nut/nuttx/boards/arm/stm32/nucleo-f446re/include
> > >> LN: include/arch/chip to arch/arm/include/stm32
> > >> LN: arch/arm/src/board to /home/slo/nut/nuttx/boards/arm/stm32/nucleo-f446re/../common
> > >> LN: arch/arm/src/board/board to /home/slo/nut/nuttx/boards/arm/stm32/nucleo-f446re/src
> > >> LN: arch/arm/src/chip to arch/arm/src/stm32
> > >> LN: /home/slo/nut/nuttx/drivers/platform to /home/slo/nut/nuttx/drivers/dummy
> > >>
> > >> and it builds, because it uses the original dev board
> > >>
> > >> So in fact using configure with a custom board path DOES NOT work. It just configures whatever built in board is indicated in the config file.
> > >>
> > >> Then I tried to change the board path using make menuconfig, then make again, and then it stops building as before: '*** No rule to make target 'libboard.a'.'
> > >>
> > >> Sebastien
> > >>
> > >>
> > >> Le 20/05/2021 à 13:44, Abdelatif Guettouche a écrit :
> > >>> Hi,
> > >>>
> > >>> Is it possible to share the defconfig?  I just tried with an old one
> > >>> (based on STM32) and I have a clean build.
> > >>> The relevant configs that need to be correctly set are:
> > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../boards/stm32/board-dir"
> > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="Custom-STM32-Board"
> > >>>
> > >>> On Thu, May 20, 2021 at 10:47 AM Sebastien Lorquet <se...@lorquet.fr> wrote:
> > >>>> Hello,
> > >>>>
> > >>>> I have to update the nuttx in our project from pre-apache to last version.
> > >>>>
> > >>>> We would like to use the external board feature.
> > >>>>
> > >>>> As a test I copied the nucleo-f446re folder in boards/arm to somewhere
> > >>>> else (sibling to apps and nuttx), renamed it, and pointed to it in the
> > >>>> configuration. make menuconfig was happy with that.
> > >>>>
> > >>>> However the build fails:
> > >>>>
> > >>>> IN: fs/libfs.a -> staging/libfs.a
> > >>>> make[1]: Entering directory '/home/slo/nut/nuttx/binfmt'
> > >>>> CC:  binfmt_globals.c
> > >>>> CC:  binfmt_initialize.c
> > >>>> CC:  binfmt_register.c
> > >>>> CC:  binfmt_unregister.c
> > >>>> CC:  binfmt_loadmodule.c
> > >>>> CC:  binfmt_unloadmodule.c
> > >>>> CC:  binfmt_execmodule.c
> > >>>> CC:  binfmt_exec.c
> > >>>> CC:  binfmt_copyargv.c
> > >>>> CC:  binfmt_dumpmodule.c
> > >>>> CC:  builtin.c
> > >>>> AR (create): libbinfmt.a   binfmt_globals.o binfmt_initialize.o
> > >>>> binfmt_register.o binfmt_unregister.o binfmt_loadmodule.o
> > >>>> binfmt_unloadmodule.o binfmt_execmodule.o binfmt_exec.o
> > >>>> binfmt_copyargv.o binfmt_dumpmodule.o builtin.o
> > >>>> make[1]: Leaving directory '/home/slo/nut/nuttx/binfmt'
> > >>>> IN: binfmt/libbinfmt.a -> staging/libbinfmt.a
> > >>>> make[1]: Entering directory '/home/slo/nut/nuttx/arch/arm/src'
> > >>>> make[2]: Entering directory '/home/slo/nut/my_own_nucleo/src'
> > >>>> make[2]: *** No rule to make target 'libboard.a'.  Stop.
> > >>>> make[2]: Leaving directory '/home/slo/nut/my_own_nucleo/src'
> > >>>> make[1]: *** [Makefile:152: board/libboard.a] Error 2
> > >>>> make[1]: Leaving directory '/home/slo/nut/nuttx/arch/arm/src'
> > >>>> make: *** [tools/Makefile.unix:422: nuttx] Error 2
> > >>>>
> > >>>> Looks like a Makefile (or just a rule) is missing. Is it a bug in this
> > >>>> board/arch or in my own method or a problem in the external board build
> > >>>> system?
> > >>>>
> > >>>> I'm using a relative board path.
> > >>>>
> > >>>> I'll add a github issue when the problem is understood.
> > >>>>
> > >>>> Sebastien
> > >>>>

Re: external board build failure

Posted by Abdelatif Guettouche <ab...@gmail.com>.
(It looks like we dropped the list somehow, I'm bringing it back...)

> There is no way this common file is going into my custom board.

If you don't want it; just remove it.  But you'll have to adapt your
Make.defs file.  Mainly adding "include $(TOPDIR)/boards/Board.mk" at
the end.
Other small things could be required. Adapt it from a different board
that doesn't have a common directory, an STM32F7 for example, it will
be simpler.


On Thu, May 20, 2021 at 2:11 PM Sebastien Lorquet <se...@lorquet.fr> wrote:
>
> This entirely defeat the purpose of a custom board.
>
> There is no way this common file is going into my custom board.
>
> What to do? Do I need TWO custom dirs? One for the board and one for the
> custom stuff?
>
> Sebastien
>
> Le 20/05/2021 à 15:08, Abdelatif Guettouche a écrit :
> > It should then also be the same case as #2206, you'll need the common
> > directory: https://github.com/apache/incubator-nuttx/issues/2206#issuecomment-721141748
> >
> > For STM32 (and other chips that have the "common" directory
> > structure), the stm32/board_dir/src/Make.defs file is not complete.
> > It needs the stm32/common/Makefile in order to get everything hooked
> > into the build system.
> >
> > On Thu, May 20, 2021 at 2:01 PM Sebastien Lorquet <se...@lorquet.fr> wrote:
> >> It was the defconfig from nucleo-f446re:nsh, only modified to use a
> >> custom board with relpath.
> >>
> >> The same failure happens with the stm32f427i-disco:nsh configuration.
> >>
> >>
> >> I have the same issues as described in 2206
> >>
> >> I have tried running: tools/configure.sh ../my_own_nucleo/configs/nsh
> >>
> >> And the log shows:
> >>
> >> LN: include/arch to arch/arm/include
> >> LN: include/arch/board to /home/slo/nut/nuttx/boards/arm/stm32/nucleo-f446re/include
> >> LN: include/arch/chip to arch/arm/include/stm32
> >> LN: arch/arm/src/board to /home/slo/nut/nuttx/boards/arm/stm32/nucleo-f446re/../common
> >> LN: arch/arm/src/board/board to /home/slo/nut/nuttx/boards/arm/stm32/nucleo-f446re/src
> >> LN: arch/arm/src/chip to arch/arm/src/stm32
> >> LN: /home/slo/nut/nuttx/drivers/platform to /home/slo/nut/nuttx/drivers/dummy
> >>
> >> and it builds, because it uses the original dev board
> >>
> >> So in fact using configure with a custom board path DOES NOT work. It just configures whatever built in board is indicated in the config file.
> >>
> >> Then I tried to change the board path using make menuconfig, then make again, and then it stops building as before: '*** No rule to make target 'libboard.a'.'
> >>
> >> Sebastien
> >>
> >>
> >> Le 20/05/2021 à 13:44, Abdelatif Guettouche a écrit :
> >>> Hi,
> >>>
> >>> Is it possible to share the defconfig?  I just tried with an old one
> >>> (based on STM32) and I have a clean build.
> >>> The relevant configs that need to be correctly set are:
> >>> CONFIG_ARCH_BOARD_CUSTOM=y
> >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../boards/stm32/board-dir"
> >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="Custom-STM32-Board"
> >>>
> >>> On Thu, May 20, 2021 at 10:47 AM Sebastien Lorquet <se...@lorquet.fr> wrote:
> >>>> Hello,
> >>>>
> >>>> I have to update the nuttx in our project from pre-apache to last version.
> >>>>
> >>>> We would like to use the external board feature.
> >>>>
> >>>> As a test I copied the nucleo-f446re folder in boards/arm to somewhere
> >>>> else (sibling to apps and nuttx), renamed it, and pointed to it in the
> >>>> configuration. make menuconfig was happy with that.
> >>>>
> >>>> However the build fails:
> >>>>
> >>>> IN: fs/libfs.a -> staging/libfs.a
> >>>> make[1]: Entering directory '/home/slo/nut/nuttx/binfmt'
> >>>> CC:  binfmt_globals.c
> >>>> CC:  binfmt_initialize.c
> >>>> CC:  binfmt_register.c
> >>>> CC:  binfmt_unregister.c
> >>>> CC:  binfmt_loadmodule.c
> >>>> CC:  binfmt_unloadmodule.c
> >>>> CC:  binfmt_execmodule.c
> >>>> CC:  binfmt_exec.c
> >>>> CC:  binfmt_copyargv.c
> >>>> CC:  binfmt_dumpmodule.c
> >>>> CC:  builtin.c
> >>>> AR (create): libbinfmt.a   binfmt_globals.o binfmt_initialize.o
> >>>> binfmt_register.o binfmt_unregister.o binfmt_loadmodule.o
> >>>> binfmt_unloadmodule.o binfmt_execmodule.o binfmt_exec.o
> >>>> binfmt_copyargv.o binfmt_dumpmodule.o builtin.o
> >>>> make[1]: Leaving directory '/home/slo/nut/nuttx/binfmt'
> >>>> IN: binfmt/libbinfmt.a -> staging/libbinfmt.a
> >>>> make[1]: Entering directory '/home/slo/nut/nuttx/arch/arm/src'
> >>>> make[2]: Entering directory '/home/slo/nut/my_own_nucleo/src'
> >>>> make[2]: *** No rule to make target 'libboard.a'.  Stop.
> >>>> make[2]: Leaving directory '/home/slo/nut/my_own_nucleo/src'
> >>>> make[1]: *** [Makefile:152: board/libboard.a] Error 2
> >>>> make[1]: Leaving directory '/home/slo/nut/nuttx/arch/arm/src'
> >>>> make: *** [tools/Makefile.unix:422: nuttx] Error 2
> >>>>
> >>>> Looks like a Makefile (or just a rule) is missing. Is it a bug in this
> >>>> board/arch or in my own method or a problem in the external board build
> >>>> system?
> >>>>
> >>>> I'm using a relative board path.
> >>>>
> >>>> I'll add a github issue when the problem is understood.
> >>>>
> >>>> Sebastien
> >>>>

Re: external board build failure

Posted by Abdelatif Guettouche <ab...@gmail.com>.
Hi,

Is it possible to share the defconfig?  I just tried with an old one
(based on STM32) and I have a clean build.
The relevant configs that need to be correctly set are:
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../boards/stm32/board-dir"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="Custom-STM32-Board"

On Thu, May 20, 2021 at 10:47 AM Sebastien Lorquet <se...@lorquet.fr> wrote:
>
> Hello,
>
> I have to update the nuttx in our project from pre-apache to last version.
>
> We would like to use the external board feature.
>
> As a test I copied the nucleo-f446re folder in boards/arm to somewhere
> else (sibling to apps and nuttx), renamed it, and pointed to it in the
> configuration. make menuconfig was happy with that.
>
> However the build fails:
>
> IN: fs/libfs.a -> staging/libfs.a
> make[1]: Entering directory '/home/slo/nut/nuttx/binfmt'
> CC:  binfmt_globals.c
> CC:  binfmt_initialize.c
> CC:  binfmt_register.c
> CC:  binfmt_unregister.c
> CC:  binfmt_loadmodule.c
> CC:  binfmt_unloadmodule.c
> CC:  binfmt_execmodule.c
> CC:  binfmt_exec.c
> CC:  binfmt_copyargv.c
> CC:  binfmt_dumpmodule.c
> CC:  builtin.c
> AR (create): libbinfmt.a   binfmt_globals.o binfmt_initialize.o
> binfmt_register.o binfmt_unregister.o binfmt_loadmodule.o
> binfmt_unloadmodule.o binfmt_execmodule.o binfmt_exec.o
> binfmt_copyargv.o binfmt_dumpmodule.o builtin.o
> make[1]: Leaving directory '/home/slo/nut/nuttx/binfmt'
> IN: binfmt/libbinfmt.a -> staging/libbinfmt.a
> make[1]: Entering directory '/home/slo/nut/nuttx/arch/arm/src'
> make[2]: Entering directory '/home/slo/nut/my_own_nucleo/src'
> make[2]: *** No rule to make target 'libboard.a'.  Stop.
> make[2]: Leaving directory '/home/slo/nut/my_own_nucleo/src'
> make[1]: *** [Makefile:152: board/libboard.a] Error 2
> make[1]: Leaving directory '/home/slo/nut/nuttx/arch/arm/src'
> make: *** [tools/Makefile.unix:422: nuttx] Error 2
>
> Looks like a Makefile (or just a rule) is missing. Is it a bug in this
> board/arch or in my own method or a problem in the external board build
> system?
>
> I'm using a relative board path.
>
> I'll add a github issue when the problem is understood.
>
> Sebastien
>