You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Daniel Pereira Carvalho <da...@gmail.com> on 2022/03/02 22:06:36 UTC

Error when building custom board

Hi guys,

I am having problems building custom boards outside of the Nuttx folder
tree. Usually I use the following folder structure.

|-> apps
|-> my-folder
   |-> my-apps
      |-> custom-app
   |-> my-boards
      |-> custom-board
|-> nuttx

To build my apps I just need to create a symbolic link called external
inside apps folder. To create a new custom board I start copying a similar
board (e.g nucleo-g431kb) to my-boards folder and make the following changes

*remove from defconfig:*
CONFIG_ARCH_BOARD="nucleo-g431kb"
CONFIG_ARCH_BOARD_NUCLEO_G431KB=y

*add on defconfig:*
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"

*Rename src/Make.defs to src/Makefile and append the line *
include $(TOPDIR)/boards/Board.mk at the end of file.

This works well for me up to Nuttx version 10.2.0 but now when I try to
make I got the errors

make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
Create version.h
make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
make[2]: Entering directory
'/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
Makefile:23: board/Make.defs: No such file or directory
make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
make[2]: Leaving directory
'/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
make[1]: *** [Makefile:79: context] Error 2
make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
make: *** [tools/Unix.mk:425: boards/.context] Error 2

Does anyone know how to fix this problem?

Thanks

Daniel Pereira de Carvalho

Re: Error when building custom board

Posted by Abdelatif Guettouche <ab...@gmail.com>.
Please check the common/Make.defs file in-tree of the board you based your
custom board on. There is a new variable introduced.
(Sorry, writing from my phone. I'll try to send a direct link later.)

On Thu, Mar 3, 2022, 07:10 Petro Karashchenko <pe...@gmail.com>
wrote:

> Hi,
>
> Do you want to use board common code? There where some code tree
> restructurings to eliminate code duplication. There is an option to
> enable/disable common code in menu config. Please try to use it and
> feedback if it helps you.
>
> Best regards,
> Petro
>
>
> On Thu, Mar 3, 2022, 12:06 AM Daniel Pereira Carvalho <danieloak@gmail.com
> >
> wrote:
>
> > Hi guys,
> >
> > I am having problems building custom boards outside of the Nuttx folder
> > tree. Usually I use the following folder structure.
> >
> > |-> apps
> > |-> my-folder
> >    |-> my-apps
> >       |-> custom-app
> >    |-> my-boards
> >       |-> custom-board
> > |-> nuttx
> >
> > To build my apps I just need to create a symbolic link called external
> > inside apps folder. To create a new custom board I start copying a
> similar
> > board (e.g nucleo-g431kb) to my-boards folder and make the following
> > changes
> >
> > *remove from defconfig:*
> > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> >
> > *add on defconfig:*
> > CONFIG_ARCH_BOARD_CUSTOM=y
> > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> >
> > *Rename src/Make.defs to src/Makefile and append the line *
> > include $(TOPDIR)/boards/Board.mk at the end of file.
> >
> > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > make I got the errors
> >
> > make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > Create version.h
> > make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > make[2]: Entering directory
> > '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > Makefile:23: board/Make.defs: No such file or directory
> > make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > make[2]: Leaving directory
> > '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > make[1]: *** [Makefile:79: context] Error 2
> > make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > make: *** [tools/Unix.mk:425: boards/.context] Error 2
> >
> > Does anyone know how to fix this problem?
> >
> > Thanks
> >
> > Daniel Pereira de Carvalho
> >
>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hi,

Do you want to use board common code? There where some code tree
restructurings to eliminate code duplication. There is an option to
enable/disable common code in menu config. Please try to use it and
feedback if it helps you.

Best regards,
Petro


On Thu, Mar 3, 2022, 12:06 AM Daniel Pereira Carvalho <da...@gmail.com>
wrote:

> Hi guys,
>
> I am having problems building custom boards outside of the Nuttx folder
> tree. Usually I use the following folder structure.
>
> |-> apps
> |-> my-folder
>    |-> my-apps
>       |-> custom-app
>    |-> my-boards
>       |-> custom-board
> |-> nuttx
>
> To build my apps I just need to create a symbolic link called external
> inside apps folder. To create a new custom board I start copying a similar
> board (e.g nucleo-g431kb) to my-boards folder and make the following
> changes
>
> *remove from defconfig:*
> CONFIG_ARCH_BOARD="nucleo-g431kb"
> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
>
> *add on defconfig:*
> CONFIG_ARCH_BOARD_CUSTOM=y
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
>
> *Rename src/Make.defs to src/Makefile and append the line *
> include $(TOPDIR)/boards/Board.mk at the end of file.
>
> This works well for me up to Nuttx version 10.2.0 but now when I try to
> make I got the errors
>
> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> Create version.h
> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> make[2]: Entering directory
> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> Makefile:23: board/Make.defs: No such file or directory
> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> make[2]: Leaving directory
> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> make[1]: *** [Makefile:79: context] Error 2
> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> make: *** [tools/Unix.mk:425: boards/.context] Error 2
>
> Does anyone know how to fix this problem?
>
> Thanks
>
> Daniel Pereira de Carvalho
>

Re: Error when building custom board

Posted by Jukka Laitinen <ju...@iki.fi>.
Hi,

It is working fine for me now, thanks!

-jukka

On 17.3.2022 15.22, Petro Karashchenko wrote:
> Helo Jukka,
>
> I just want to confirm that you do not have any issues with the build on
> the latest mainline.
>
> Best regards,
> Petro
>
> пт, 11 бер. 2022 р. о 08:12 Jukka Laitinen <ju...@iki.fi> пише:
>
>> Hi,
>>
>> With this patch, all my targets fail with:
>>
>> Makefile:23: board/Make.defs: No such file or directory
>> make[3]: *** No rule to make target 'board/Make.defs'.  Stop.
>>
>> Should I add some new CONFIGs? Sorry but I don't have much time today to
>> debug this further
>>
>> -Jukka
>>
>>
>> On 10.3.2022 21.00, Petro Karashchenko wrote:
>>> Hello Jukka,
>>>
>>> I would like to ask you to try an alternative PR
>>> https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
>>> works for you.
>>>
>>> Best regards,
>>> Petro
>>>
>>> чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen <ju...@iki.fi> пише:
>>>> Hi,
>>>>
>>>> This fixes the build for me, I just leave the
>>>> CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
>>>>
>>>> Thanks,
>>>>
>>>> Jukka
>>>>
>>>> On 9.3.2022 19.22, Petro Karashchenko wrote:
>>>>> Hello Jukka,
>>>>>
>>>>> I was able to localize the root cause of the issue. I've created
>>>>> https://github.com/apache/incubator-nuttx/pull/5705 to recover things
>>>>> and added a separate option that should be explicitly enabled to
>>>>> re-use a board-level common code by custom boards users.
>>>>>
>>>>> Please try this change and feedback if that solves the problem.
>>>>>
>>>>> Best regards,
>>>>> Petro
>>>>>
>>>>> чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <ju...@iki.fi>
>> пише:
>>>>>> Hi, sorry but I am away from computer atm.
>>>>>>
>>>>>> In the project there is "packaging" subdirectory, it contains some
>> docker env, which is also used in TII's CI
>>>>>> - Jukka
>>>>>>
>>>>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
>>>>>>> Hello Jukka,
>>>>>>>
>>>>>>> Do you have any steps on how to build or download a docker image that
>>>>>>> can be used to build that project?
>>>>>>> It takes me too much time to get build running.
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Petro
>>>>>>>
>>>>>>> чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi>
>> пише:
>>>>>>>> And also note that the commit I mentioned is already reverted in
>> nuttx submodule, so you need to put it back in order to re-produce the
>> issue :)
>>>>>>>>
>>>>>>>> Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
>>>>>>>>> Hi, sorry about that; you can just remove that submodule, it is
>> not needed to re-produce the issue.
>>>>>>>>> - Jukka
>>>>>>>>>
>>>>>>>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
>>>>>>>>>> Hi Jukka,
>>>>>>>>>>
>>>>>>>>>> I tried to replicate your case, but failed with:
>>>>>>>>>> $ git submodule update --init --recursive
>>>>>>>>>> Cloning into
>> '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
>>>>>>>>>> ERROR: Repository not found.
>>>>>>>>>> fatal: Could not read from remote repository.
>>>>>>>>>>
>>>>>>>>>> Please make sure you have the correct access rights
>>>>>>>>>> and the repository exists.
>>>>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into
>> submodule
>>>>>>>>>> path
>> '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
>>>>>>>>>> failed
>>>>>>>>>> Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
>>>>>>>>>> Cloning into
>> '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
>>>>>>>>>> ERROR: Repository not found.
>>>>>>>>>> fatal: Could not read from remote repository.
>>>>>>>>>>
>>>>>>>>>> Please make sure you have the correct access rights
>>>>>>>>>> and the repository exists.
>>>>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into
>> submodule
>>>>>>>>>> path
>> '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
>>>>>>>>>> failed
>>>>>>>>>> Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>> Petro
>>>>>>>>>>
>>>>>>>>>> чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi>
>> пише:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Maybe I was jumping in to conclusion and the issue is not the
>> same as
>>>>>>>>>>> what I had. I was building PX4, which uses CMake build system,
>> so I am
>>>>>>>>>>> not having any Makefile or Make.defs in my own board directory.
>> Also the
>>>>>>>>>>> platform is not stm or arm, but risc-v.
>>>>>>>>>>>
>>>>>>>>>>> Anyhow, this is the error which I started getting in my build
>> scripts:
>>>>>>>>>>> "
>>>>>>>>>>>
>>>>>>>>>>> ninja: error:
>>>>>>>>>>> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board',
>> needed by
>>>>>>>>>>> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
>>>>>>>>>>> make: *** [Makefile:225: ssrc_icicle_default] Error 1
>>>>>>>>>>> "
>>>>>>>>>>>
>>>>>>>>>>> My configs are:
>>>>>>>>>>>
>>>>>>>>>>> CONFIG_ARCH="risc-v"
>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
>>>>>>>>>>>
>>>>>>>>>>> One version, where it fails is available publicly in
>>>>>>>>>>>
>>>>>>>>>>> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a
>> submodule)
>>>>>>>>>>> Building "make ssrc_icicle_default". The board files are in
>>>>>>>>>>> boards/ssrc/icicle/nuttx-config and NuttX cloned in
>>>>>>>>>>> platforms/nuttx/Nuttx/nuttx.
>>>>>>>>>>>
>>>>>>>>>>> I didn't yet start looking into it in detail, what goes wrong,
>> just
>>>>>>>>>>> bisected the nuttx and reverted the commit which broke it for
>> me. I need
>>>>>>>>>>> to look back later to see how to change the off-tree board
>> config to get
>>>>>>>>>>> it back online.
>>>>>>>>>>>
>>>>>>>>>>> Just noticed that the error is somewhat similar, although coming
>> from
>>>>>>>>>>> different build env. But in my case it is likely that I need to
>> adapt
>>>>>>>>>>> the cmake build scripts according to the changes in nuttx.
>>>>>>>>>>>
>>>>>>>>>>> -Jukka
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 3.3.2022 9.37, Petro Karashchenko wrote:
>>>>>>>>>>>> Hello Jukka,
>>>>>>>>>>>>
>>>>>>>>>>>> So you experience the same problem as Daniel and reverting the
>> commit helps?
>>>>>>>>>>>> Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no
>> way to
>>>>>>>>>>>> reuse common code from "nuttx/board/...". I'm using a custom
>> board
>>>>>>>>>>>> based on SAME70 and after
>>>>>>>>>>>> https://github.com/apache/incubator-nuttx/pull/4981 I found my
>> code
>>>>>>>>>>>> tree broken. Now the folder structure for "boards/arm/samv7" is
>> the
>>>>>>>>>>>> same as in "boards/arm/stm32". Here is what I did to get it back
>>>>>>>>>>>> running:
>>>>>>>>>>>> 1. Synced "custom-board/scripts/Make.defs" with
>>>>>>>>>>>> "boards/arm/samv7/same70-xplained/scripts/Make.defs"
>>>>>>>>>>>> 2. Renamed "custom-board/src/Makefile" to
>> "custom-board/src/Make.defs"
>>>>>>>>>>>> and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
>>>>>>>>>>>> 3. Removed files in my code tree that have exactly the same
>>>>>>>>>>>> implementation as files from "boards/arm/samv7/common"
>>>>>>>>>>>>
>>>>>>>>>>>> It seems like Daniel is hitting the same issue, so I expect that
>>>>>>>>>>>> renaming Makefile to Make.defs plus setting
>> "BOARD_STM32_COMMON=n"
>>>>>>>>>>>> should fix the issue without any additional file clean-up.
>>>>>>>>>>>> Please give me feedback if that helps.
>>>>>>>>>>>>
>>>>>>>>>>>> Best regards,
>>>>>>>>>>>> Petro
>>>>>>>>>>>>
>>>>>>>>>>>> чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <
>> jukka.laitinen@iki.fi> пише:
>>>>>>>>>>>>> HI,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Not sure what is the correct way to fix this, but I reverted:
>>>>>>>>>>>>>
>>>>>>>>>>>>> "
>>>>>>>>>>>>>
>>>>>>>>>>>>> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
>>>>>>>>>>>>> Author: Petro Karashchenko <pe...@gmail.com>
>>>>>>>>>>>>> Date:   Wed Jan 19 11:16:11 2022 +0200
>>>>>>>>>>>>>
>>>>>>>>>>>>>          tools: add option to reuse boards common files for
>> custom boards
>>>>>>>>>>>>>          Signed-off-by: Petro Karashchenko <
>> petro.karashchenko@gmail.com>
>>>>>>>>>>>>> "
>>>>>>>>>>>>>
>>>>>>>>>>>>> Petro, what is the proper way to configure this?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Jukka
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi guys,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I am having problems building custom boards outside of the
>> Nuttx folder
>>>>>>>>>>>>>> tree. Usually I use the following folder structure.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> |-> apps
>>>>>>>>>>>>>> |-> my-folder
>>>>>>>>>>>>>>         |-> my-apps
>>>>>>>>>>>>>>            |-> custom-app
>>>>>>>>>>>>>>         |-> my-boards
>>>>>>>>>>>>>>            |-> custom-board
>>>>>>>>>>>>>> |-> nuttx
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> To build my apps I just need to create a symbolic link called
>> external
>>>>>>>>>>>>>> inside apps folder. To create a new custom board I start
>> copying a similar
>>>>>>>>>>>>>> board (e.g nucleo-g431kb) to my-boards folder and make the
>> following changes
>>>>>>>>>>>>>> *remove from defconfig:*
>>>>>>>>>>>>>> CONFIG_ARCH_BOARD="nucleo-g431kb"
>>>>>>>>>>>>>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> *add on defconfig:*
>>>>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
>>>>>>>>>>>>>>
>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
>>>>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
>>>>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> *Rename src/Make.defs to src/Makefile and append the line *
>>>>>>>>>>>>>> include $(TOPDIR)/boards/Board.mk at the end of file.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> This works well for me up to Nuttx version 10.2.0 but now
>> when I try to
>>>>>>>>>>>>>> make I got the errors
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> make[1]: Entering directory
>> '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>>>>>> make[1]: Leaving directory
>> '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>>>>>> make[1]: Entering directory
>> '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>>>>>> make[1]: Leaving directory
>> '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>>>>>> Create version.h
>>>>>>>>>>>>>> make[1]: Entering directory
>> '/home/daniel/nuttx-workspace/nuttx/boards'
>>>>>>>>>>>>>> make[2]: Entering directory
>>>>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
>>>>>>>>>>>>>> Makefile:23: board/Make.defs: No such file or directory
>>>>>>>>>>>>>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
>>>>>>>>>>>>>> make[2]: Leaving directory
>>>>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
>>>>>>>>>>>>>> make[1]: *** [Makefile:79: context] Error 2
>>>>>>>>>>>>>> make[1]: Leaving directory
>> '/home/daniel/nuttx-workspace/nuttx/boards'
>>>>>>>>>>>>>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Does anyone know how to fix this problem?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Daniel Pereira de Carvalho
>>>>>>>>>>>>>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Helo Jukka,

I just want to confirm that you do not have any issues with the build on
the latest mainline.

Best regards,
Petro

пт, 11 бер. 2022 р. о 08:12 Jukka Laitinen <ju...@iki.fi> пише:

> Hi,
>
> With this patch, all my targets fail with:
>
> Makefile:23: board/Make.defs: No such file or directory
> make[3]: *** No rule to make target 'board/Make.defs'.  Stop.
>
> Should I add some new CONFIGs? Sorry but I don't have much time today to
> debug this further
>
> -Jukka
>
>
> On 10.3.2022 21.00, Petro Karashchenko wrote:
> > Hello Jukka,
> >
> > I would like to ask you to try an alternative PR
> > https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
> > works for you.
> >
> > Best regards,
> > Petro
> >
> > чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen <ju...@iki.fi> пише:
> >> Hi,
> >>
> >> This fixes the build for me, I just leave the
> >> CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
> >>
> >> Thanks,
> >>
> >> Jukka
> >>
> >> On 9.3.2022 19.22, Petro Karashchenko wrote:
> >>> Hello Jukka,
> >>>
> >>> I was able to localize the root cause of the issue. I've created
> >>> https://github.com/apache/incubator-nuttx/pull/5705 to recover things
> >>> and added a separate option that should be explicitly enabled to
> >>> re-use a board-level common code by custom boards users.
> >>>
> >>> Please try this change and feedback if that solves the problem.
> >>>
> >>> Best regards,
> >>> Petro
> >>>
> >>> чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <ju...@iki.fi>
> пише:
> >>>> Hi, sorry but I am away from computer atm.
> >>>>
> >>>> In the project there is "packaging" subdirectory, it contains some
> docker env, which is also used in TII's CI
> >>>>
> >>>> - Jukka
> >>>>
> >>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> >>>>> Hello Jukka,
> >>>>>
> >>>>> Do you have any steps on how to build or download a docker image that
> >>>>> can be used to build that project?
> >>>>> It takes me too much time to get build running.
> >>>>>
> >>>>> Best regards,
> >>>>> Petro
> >>>>>
> >>>>> чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi>
> пише:
> >>>>>> And also note that the commit I mentioned is already reverted in
> nuttx submodule, so you need to put it back in order to re-produce the
> issue :)
> >>>>>>
> >>>>>>
> >>>>>> Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> >>>>>>> Hi, sorry about that; you can just remove that submodule, it is
> not needed to re-produce the issue.
> >>>>>>>
> >>>>>>> - Jukka
> >>>>>>>
> >>>>>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> >>>>>>>> Hi Jukka,
> >>>>>>>>
> >>>>>>>> I tried to replicate your case, but failed with:
> >>>>>>>> $ git submodule update --init --recursive
> >>>>>>>> Cloning into
> '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> >>>>>>>> ERROR: Repository not found.
> >>>>>>>> fatal: Could not read from remote repository.
> >>>>>>>>
> >>>>>>>> Please make sure you have the correct access rights
> >>>>>>>> and the repository exists.
> >>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into
> submodule
> >>>>>>>> path
> '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> >>>>>>>> failed
> >>>>>>>> Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> >>>>>>>> Cloning into
> '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> >>>>>>>> ERROR: Repository not found.
> >>>>>>>> fatal: Could not read from remote repository.
> >>>>>>>>
> >>>>>>>> Please make sure you have the correct access rights
> >>>>>>>> and the repository exists.
> >>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into
> submodule
> >>>>>>>> path
> '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> >>>>>>>> failed
> >>>>>>>> Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> >>>>>>>>
> >>>>>>>> Best regards,
> >>>>>>>> Petro
> >>>>>>>>
> >>>>>>>> чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi>
> пише:
> >>>>>>>>> Hi,
> >>>>>>>>>
> >>>>>>>>> Maybe I was jumping in to conclusion and the issue is not the
> same as
> >>>>>>>>> what I had. I was building PX4, which uses CMake build system,
> so I am
> >>>>>>>>> not having any Makefile or Make.defs in my own board directory.
> Also the
> >>>>>>>>> platform is not stm or arm, but risc-v.
> >>>>>>>>>
> >>>>>>>>> Anyhow, this is the error which I started getting in my build
> scripts:
> >>>>>>>>>
> >>>>>>>>> "
> >>>>>>>>>
> >>>>>>>>> ninja: error:
> >>>>>>>>> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board',
> needed by
> >>>>>>>>> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> >>>>>>>>> make: *** [Makefile:225: ssrc_icicle_default] Error 1
> >>>>>>>>> "
> >>>>>>>>>
> >>>>>>>>> My configs are:
> >>>>>>>>>
> >>>>>>>>> CONFIG_ARCH="risc-v"
> >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
> >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> >>>>>>>>>
> >>>>>>>>> One version, where it fails is available publicly in
> >>>>>>>>>
> >>>>>>>>> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a
> submodule)
> >>>>>>>>>
> >>>>>>>>> Building "make ssrc_icicle_default". The board files are in
> >>>>>>>>> boards/ssrc/icicle/nuttx-config and NuttX cloned in
> >>>>>>>>> platforms/nuttx/Nuttx/nuttx.
> >>>>>>>>>
> >>>>>>>>> I didn't yet start looking into it in detail, what goes wrong,
> just
> >>>>>>>>> bisected the nuttx and reverted the commit which broke it for
> me. I need
> >>>>>>>>> to look back later to see how to change the off-tree board
> config to get
> >>>>>>>>> it back online.
> >>>>>>>>>
> >>>>>>>>> Just noticed that the error is somewhat similar, although coming
> from
> >>>>>>>>> different build env. But in my case it is likely that I need to
> adapt
> >>>>>>>>> the cmake build scripts according to the changes in nuttx.
> >>>>>>>>>
> >>>>>>>>> -Jukka
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On 3.3.2022 9.37, Petro Karashchenko wrote:
> >>>>>>>>>> Hello Jukka,
> >>>>>>>>>>
> >>>>>>>>>> So you experience the same problem as Daniel and reverting the
> commit helps?
> >>>>>>>>>>
> >>>>>>>>>> Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no
> way to
> >>>>>>>>>> reuse common code from "nuttx/board/...". I'm using a custom
> board
> >>>>>>>>>> based on SAME70 and after
> >>>>>>>>>> https://github.com/apache/incubator-nuttx/pull/4981 I found my
> code
> >>>>>>>>>> tree broken. Now the folder structure for "boards/arm/samv7" is
> the
> >>>>>>>>>> same as in "boards/arm/stm32". Here is what I did to get it back
> >>>>>>>>>> running:
> >>>>>>>>>> 1. Synced "custom-board/scripts/Make.defs" with
> >>>>>>>>>> "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> >>>>>>>>>> 2. Renamed "custom-board/src/Makefile" to
> "custom-board/src/Make.defs"
> >>>>>>>>>> and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> >>>>>>>>>> 3. Removed files in my code tree that have exactly the same
> >>>>>>>>>> implementation as files from "boards/arm/samv7/common"
> >>>>>>>>>>
> >>>>>>>>>> It seems like Daniel is hitting the same issue, so I expect that
> >>>>>>>>>> renaming Makefile to Make.defs plus setting
> "BOARD_STM32_COMMON=n"
> >>>>>>>>>> should fix the issue without any additional file clean-up.
> >>>>>>>>>> Please give me feedback if that helps.
> >>>>>>>>>>
> >>>>>>>>>> Best regards,
> >>>>>>>>>> Petro
> >>>>>>>>>>
> >>>>>>>>>> чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <
> jukka.laitinen@iki.fi> пише:
> >>>>>>>>>>> HI,
> >>>>>>>>>>>
> >>>>>>>>>>> Not sure what is the correct way to fix this, but I reverted:
> >>>>>>>>>>>
> >>>>>>>>>>> "
> >>>>>>>>>>>
> >>>>>>>>>>> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> >>>>>>>>>>> Author: Petro Karashchenko <pe...@gmail.com>
> >>>>>>>>>>> Date:   Wed Jan 19 11:16:11 2022 +0200
> >>>>>>>>>>>
> >>>>>>>>>>>         tools: add option to reuse boards common files for
> custom boards
> >>>>>>>>>>>
> >>>>>>>>>>>         Signed-off-by: Petro Karashchenko <
> petro.karashchenko@gmail.com>
> >>>>>>>>>>> "
> >>>>>>>>>>>
> >>>>>>>>>>> Petro, what is the proper way to configure this?
> >>>>>>>>>>>
> >>>>>>>>>>> Thanks,
> >>>>>>>>>>>
> >>>>>>>>>>> Jukka
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> >>>>>>>>>>>
> >>>>>>>>>>>> Hi guys,
> >>>>>>>>>>>>
> >>>>>>>>>>>> I am having problems building custom boards outside of the
> Nuttx folder
> >>>>>>>>>>>> tree. Usually I use the following folder structure.
> >>>>>>>>>>>>
> >>>>>>>>>>>> |-> apps
> >>>>>>>>>>>> |-> my-folder
> >>>>>>>>>>>>        |-> my-apps
> >>>>>>>>>>>>           |-> custom-app
> >>>>>>>>>>>>        |-> my-boards
> >>>>>>>>>>>>           |-> custom-board
> >>>>>>>>>>>> |-> nuttx
> >>>>>>>>>>>>
> >>>>>>>>>>>> To build my apps I just need to create a symbolic link called
> external
> >>>>>>>>>>>> inside apps folder. To create a new custom board I start
> copying a similar
> >>>>>>>>>>>> board (e.g nucleo-g431kb) to my-boards folder and make the
> following changes
> >>>>>>>>>>>>
> >>>>>>>>>>>> *remove from defconfig:*
> >>>>>>>>>>>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> >>>>>>>>>>>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> >>>>>>>>>>>>
> >>>>>>>>>>>> *add on defconfig:*
> >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
> >>>>>>>>>>>>
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> >>>>>>>>>>>>
> >>>>>>>>>>>> *Rename src/Make.defs to src/Makefile and append the line *
> >>>>>>>>>>>> include $(TOPDIR)/boards/Board.mk at the end of file.
> >>>>>>>>>>>>
> >>>>>>>>>>>> This works well for me up to Nuttx version 10.2.0 but now
> when I try to
> >>>>>>>>>>>> make I got the errors
> >>>>>>>>>>>>
> >>>>>>>>>>>> make[1]: Entering directory
> '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>>>> make[1]: Leaving directory
> '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>>>> make[1]: Entering directory
> '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>>>> make[1]: Leaving directory
> '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>>>> Create version.h
> >>>>>>>>>>>> make[1]: Entering directory
> '/home/daniel/nuttx-workspace/nuttx/boards'
> >>>>>>>>>>>> make[2]: Entering directory
> >>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>>>>>>>>>>> Makefile:23: board/Make.defs: No such file or directory
> >>>>>>>>>>>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> >>>>>>>>>>>> make[2]: Leaving directory
> >>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>>>>>>>>>>> make[1]: *** [Makefile:79: context] Error 2
> >>>>>>>>>>>> make[1]: Leaving directory
> '/home/daniel/nuttx-workspace/nuttx/boards'
> >>>>>>>>>>>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> >>>>>>>>>>>>
> >>>>>>>>>>>> Does anyone know how to fix this problem?
> >>>>>>>>>>>>
> >>>>>>>>>>>> Thanks
> >>>>>>>>>>>>
> >>>>>>>>>>>> Daniel Pereira de Carvalho
> >>>>>>>>>>>>
>

Re: Error when building custom board

Posted by fft <ff...@feedforward.com.cn>.
Hi Petro,


I tried rename Make.defs to Makefile and append the include $(TOPDIR)/boards/Board.mk at the end of file, the build of my custom board
works well. thanks very much for your help, may your country defeat the invaders soon.


Best regards,
Zou


------------------&nbsp;Original&nbsp;------------------
From: &nbsp;"petro.karashchenko"<petro.karashchenko@gmail.com&gt;;
Date: &nbsp;Wed, Mar 16, 2022 10:25 PM
To: &nbsp;"dev"<dev@nuttx.apache.org&gt;; 

Subject: &nbsp;Re: Error when building custom board

&nbsp;

Hello Zou,

It very depends on which steps you followed to prepare your custom board
files. So if you just copied one of the board examples then even if you
didn't use common code your board was still relying on
boards/arm/stm32/common/src/Make.defs and
https://github.com/pkarashchenko/incubator-nuttx/blob/8bab629fdd854378f78d5decac51eeeb35cd4751/boards/arm/stm32/common/src/Make.defs#L21
made next lines inaccessible
VPATH += :src
CFLAGS += $(shell $(INCDIR) "$(CC)"
$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src)
DEPPATH += --dep-path src

So after you enabled CONFIG_ARCH_BOARD_COMMON the build started to work
again. If you really would like to make your board independent from common
logic you need to follow the steps that Daniel described initially:
*Rename src/Make.defs to src/Makefile and append the line *
include $(TOPDIR)/boards/Board.mk at the end of file.

I think that you can delete
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += $(shell $(INCDIR) "$(CC)"
$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)

after you rename src/Make.defs to src/Makefile. Anyway if not that should
not give any harm.

Best regards,
Petro

нд, 13 бер. 2022 р. о 02:04 fft <fft@feedforward.com.cn&gt; пише:

&gt; Hello Petro,
&gt;
&gt;
&gt; Thanks for your help, i didn't use board common code,and my custom board
&gt; defconfig had not enable BOARD_STM32_COMMON config ,but when i tried add
&gt; CONFIG_ARCH_BOARD_COMMON=y to my custom board defconfig according to your
&gt; suggestion, the compile did succeed. Besides, I found that if the
&gt; CONFIG_ARCH_BOARD_COMMON=y was not add to my custom board defconfig,
&gt; there's no symbolic link of my custom board in
&gt; ./nuttx/boards/arm/stm32/common, I think it's this that led to the compile
&gt; error, but i don't known why.
&gt;
&gt;
&gt; my custom board Make.defs begin with include $(TOPDIR)/Make.defs and end
&gt; with
&gt; DEPPATH += --dep-path board
&gt; VPATH += :board
&gt; CFLAGS += $(shell $(INCDIR) "$(CC)"
&gt; $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)
&gt;
&gt;
&gt; Is it correct or not?
&gt;
&gt;
&gt; Best regards,
&gt; Zou
&gt;
&gt;
&gt; ------------------&amp;nbsp;Original&amp;nbsp;------------------
&gt; From: &amp;nbsp;"petro.karashchenko"<petro.karashchenko@gmail.com&amp;gt;;
&gt; Date: &amp;nbsp;Sun, Mar 13, 2022 01:14 AM
&gt; To: &amp;nbsp;"dev"<dev@nuttx.apache.org&amp;gt;;
&gt;
&gt; Subject: &amp;nbsp;Re: Error when building custom board
&gt;
&gt; &amp;nbsp;
&gt;
&gt; Hello Zou,
&gt;
&gt; The https://github.com/apache/incubator-nuttx/pull/5712 unifies board
&gt; common logic usage under a single option ARCH_BOARD_COMMON that is
&gt; introduced instead of per-arch options like BOARD_SAMV7_COMMON or
&gt; BOARD_STM32_COMMON. So most probably if your board defconfig had
&gt; BOARD_STM32_COMMON config enabled you need to replace it with
&gt; ARCH_BOARD_COMMON option. Also while working on
&gt; https://github.com/apache/incubator-nuttx/pull/5712 I found out that
&gt; some boards that didn't have BOARD_STM32_COMMON enabled actually used
&gt; board common code. So the way to fix your build is to remove
&gt; CONFIG_BOARD_STM32_COMMON=y from defconfig if it was present and add
&gt; CONFIG_ARCH_BOARD_COMMON=y to your board defconfig.
&gt;
&gt; Please give me feedback if that works for you. I will add a
&gt; description on how to migrate to a new NuttX release, so users will be
&gt; informed about this breaking change.
&gt;
&gt; Best regards,
&gt; Petro
&gt;
&gt; сб, 12 бер. 2022 р. о 16:10 fft <fft@feedforward.com.cn&amp;gt; пише:
&gt; &amp;gt;
&gt; &amp;gt; Hello Petro,
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; After https://github.com/apache/incubator-nuttx/pull/5712, there's a
&gt; error when building my custom board:
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; make[1]: Entering directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
&gt; &amp;gt; make[2]: Entering directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
&gt; &amp;gt; make[2]: *** No rule to make target 'libboard.a'.&amp;amp;nbsp; Stop.
&gt; &amp;gt; make[2]: Leaving directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
&gt; &amp;gt; Makefile:139: recipe for target 'board/libboard.a' failed
&gt; &amp;gt; make[1]: *** [board/libboard.a] Error 2
&gt; &amp;gt; make[1]: Leaving directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
&gt; &amp;gt; tools/Unix.mk:509: recipe for target 'nuttx' failed
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; My custom board's configs is like this:
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; CONFIG_ARCH="arm"
&gt; &amp;gt; CONFIG_ARCH_BOARD_CUSTOM=y
&gt; &amp;gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../fft/fft-f405"
&gt; &amp;gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
&gt; &amp;gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="fft-f405"
&gt; &amp;gt; CONFIG_ARCH_CHIP="stm32"
&gt; &amp;gt; CONFIG_ARCH_CHIP_STM32=y
&gt; &amp;gt; CONFIG_ARCH_CHIP_STM32F405RG=y
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; How should I modify the configuration to adapt to pull #5712 ?
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; Best regards,
&gt; &amp;gt; Zou
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; ------------------&amp;amp;nbsp;Original&amp;amp;nbsp;------------------
&gt; &amp;gt; From: &amp;amp;nbsp;"petro.karashchenko"<petro.karashchenko@gmail.com
&gt; &amp;amp;gt;;
&gt; &amp;gt; Date: &amp;amp;nbsp;Fri, Mar 11, 2022 10:41 PM
&gt; &amp;gt; To: &amp;amp;nbsp;"dev"<dev@nuttx.apache.org&amp;amp;gt;;
&gt; &amp;gt;
&gt; &amp;gt; Subject: &amp;amp;nbsp;Re: Error when building custom board
&gt; &amp;gt;
&gt; &amp;gt; &amp;amp;nbsp;
&gt; &amp;gt;
&gt; &amp;gt; Hello Jukka,
&gt; &amp;gt;
&gt; &amp;gt; Finally I was able to reproduce the situation that you are talking
&gt; &amp;gt; about. The case is that in PX4 environment the path to the board files
&gt; &amp;gt; is hardcoded to $(BOARD_DIR)/src unconditionally, but actually it
&gt; &amp;gt; depends on BOARD_COMMON_DIR value:
&gt; &amp;gt; ifneq ($(BOARD_COMMON_DIR),)
&gt; &amp;gt; ARCH_SRC_BOARD_SYMLINK=$(BOARD_COMMON_DIR)
&gt; &amp;gt; ARCH_SRC_BOARD_BOARD_SYMLINK=$(BOARD_DIR)/src
&gt; &amp;gt; else
&gt; &amp;gt; ARCH_SRC_BOARD_SYMLINK=$(BOARD_DIR)/src
&gt; &amp;gt; endif
&gt; &amp;gt;
&gt; &amp;gt; So the best solution that I can introduce without modification of PX4
&gt; &amp;gt; build system is https://github.com/apache/incubator-nuttx/pull/5715
&gt; &amp;gt <https://github.com/apache/incubator-nuttx/pull/5715&amp;gt&gt;;
&gt; &amp;gt; I do not like it a bit because this leads to a situation that leads to
&gt; &amp;gt; a need to make a distclean each time the ARCH_BOARD_COMMON is changed.
&gt; &amp;gt;
&gt; &amp;gt; Best regards,
&gt; &amp;gt; Petro
&gt; &amp;gt;
&gt; &amp;gt; Best regards,
&gt; &amp;gt; Petro
&gt; &amp;gt;
&gt; &amp;gt; пт, 11 бер. 2022 р. о 11:33 Petro Karashchenko
&gt; &amp;gt; <petro.karashchenko@gmail.com&amp;amp;gt; пише:
&gt; &amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; Hello Jukka,
&gt; &amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; I'm still in the middle of building a docker image for your
&gt; project.
&gt; &amp;gt; &amp;amp;gt; Currently with slow internet it takes a while.
&gt; &amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; But what I see from the error that you report is that
&gt; probably you
&gt; &amp;gt; &amp;amp;gt; applied https://github.com/apache/incubator-nuttx/pull/5712
&gt; while
&gt; &amp;gt; &amp;amp;gt; having https://github.com/apache/incubator-nuttx/pull/5274
&gt; still
&gt; &amp;gt; &amp;amp;gt; reverted.
&gt; &amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; I will give feedback as soon as I will replicate your issue
&gt; at my end.
&gt; &amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; Best regards,
&gt; &amp;gt; &amp;amp;gt; Petro
&gt; &amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; пт, 11 бер. 2022 р. о 08:12 Jukka Laitinen <
&gt; jukka.laitinen@iki.fi&amp;amp;gt; пише:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; Hi,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; With this patch, all my targets fail with:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; Makefile:23: board/Make.defs: No such file or
&gt; directory
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; make[3]: *** No rule to make target
&gt; 'board/Make.defs'.&amp;amp;nbsp; Stop.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; Should I add some new CONFIGs? Sorry but I don't
&gt; have much time today to
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; debug this further
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; -Jukka
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; On 10.3.2022 21.00, Petro Karashchenko wrote:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt; Hello Jukka,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt; I would like to ask you to try an
&gt; alternative PR
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt; works for you.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt; Best regards,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt; Petro
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt; чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen
&gt; <jukka.laitinen@iki.fi&amp;amp;gt; пише:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt; Hi,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt; This fixes the build for me, I
&gt; just leave the
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt; Thanks,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt; Jukka
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt; On 9.3.2022 19.22, Petro
&gt; Karashchenko wrote:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Hello Jukka,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; I was able to localize the
&gt; root cause of the issue. I've created
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; https://github.com/apache/incubator-nuttx/pull/5705 to recover things
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; and added a separate
&gt; option that should be explicitly enabled to
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; re-use a board-level
&gt; common code by custom boards users.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Please try this change and
&gt; feedback if that solves the problem.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Best regards,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Petro
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; чт, 3 бер. 2022 р. о 15:33
&gt; Jukka Laitinen <jukka.laitinen@iki.fi&amp;amp;gt; пише:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Hi, sorry but I am
&gt; away from computer atm.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; In the project
&gt; there is "packaging" subdirectory, it contains some docker env, which is
&gt; also used in TII's CI
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; - Jukka
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Petro Karashchenko
&gt; kirjoitti torstai 3. maaliskuuta 2022:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Hello
&gt; Jukka,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Do you
&gt; have any steps on how to build or download a docker image that
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; can be
&gt; used to build that project?
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; It takes
&gt; me too much time to get build running.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Best
&gt; regards,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Petro
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; чт, 3 бер.
&gt; 2022 р. о 12:43 Jukka Laitinen <jukka.laitinen@iki.fi&amp;amp;gt; пише:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; And also note that the commit I mentioned is already reverted in nuttx
&gt; submodule, so you need to put it back in order to re-produce the issue :)
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Hi, sorry about
&gt; that; you can just remove that submodule, it is not needed to re-produce
&gt; the issue.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; - Jukka
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Petro Karashchenko
&gt; kirjoitti torstai 3. maaliskuuta 2022:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Hi Jukka,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; I tried to
&gt; replicate your case, but failed with:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; $ git
&gt; submodule update --init --recursive
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Cloning
&gt; into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; ERROR:
&gt; Repository not found.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; fatal:
&gt; Could not read from remote repository.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Please
&gt; make sure you have the correct access rights
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; and the
&gt; repository exists.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; fatal:
&gt; clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; path
&gt; '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; failed
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Failed to
&gt; clone 'boards/ssrc/saluki-v1'. Retry scheduled
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Cloning
&gt; into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; ERROR:
&gt; Repository not found.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; fatal:
&gt; Could not read from remote repository.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Please
&gt; make sure you have the correct access rights
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; and the
&gt; repository exists.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; fatal:
&gt; clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; path
&gt; '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; failed
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Failed to
&gt; clone 'boards/ssrc/saluki-v1' a second time, aborting
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Best
&gt; regards,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Petro
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; чт, 3 бер.
&gt; 2022 р. о 09:34 Jukka Laitinen <jukka.laitinen@iki.fi&amp;amp;gt; пише:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Hi,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Maybe I was jumping in to conclusion and the issue is not the same as
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; what I had. I was building PX4, which uses CMake build system, so I am
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; not having any Makefile or Make.defs in my own board directory. Also the
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; platform is not stm or arm, but risc-v.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Anyhow, this is the error which I started getting in my build scripts:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; "
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; ninja: error:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make: *** [Makefile:225: ssrc_icicle_default] Error 1
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; "
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; My
&gt; configs are:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH="risc-v"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD_CUSTOM=y
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; One version, where it fails is available publicly in
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Building "make ssrc_icicle_default". The board files are in
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; boards/ssrc/icicle/nuttx-config and NuttX cloned in
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; platforms/nuttx/Nuttx/nuttx.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; I
&gt; didn't yet start looking into it in detail, what goes wrong, just
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; bisected the nuttx and reverted the commit which broke it for me. I need
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; to
&gt; look back later to see how to change the off-tree board config to get
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; it
&gt; back online.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Just noticed that the error is somewhat similar, although coming from
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; different build env. But in my case it is likely that I need to adapt
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; the cmake build scripts according to the changes in nuttx.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; -Jukka
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; On
&gt; 3.3.2022 9.37, Petro Karashchenko wrote:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Hello Jukka,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; So you experience the same problem as Daniel and reverting the commit helps?
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; reuse common code from "nuttx/board/...". I'm using a custom board
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; based on SAME70 and after
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; https://github.com/apache/incubator-nuttx/pull/4981 I found my code
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; tree broken. Now the folder structure for "boards/arm/samv7" is the
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; same as in "boards/arm/stm32". Here is what I did to get it back
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; running:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; 1. Synced "custom-board/scripts/Make.defs" with
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; "boards/arm/samv7/same70-xplained/scripts/Make.defs"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; 3. Removed files in my code tree that have exactly the same
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; implementation as files from "boards/arm/samv7/common"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; It seems like Daniel is hitting the same issue, so I expect that
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; should fix the issue without any additional file clean-up.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Please give me feedback if that helps.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Best regards,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Petro
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <jukka.laitinen@iki.fi&amp;amp;gt;
&gt; пише:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; HI,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Not sure what is the correct way to fix this, but I reverted:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; "
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Author: Petro Karashchenko <petro.karashchenko@gmail.com&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Date:&amp;amp;nbsp;&amp;amp;nbsp; Wed Jan 19 11:16:11 2022 +0200
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;
&gt; tools: add option to reuse boards common files for custom boards
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;
&gt; Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; "
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Petro, what is the proper way to configure this?
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Thanks,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Jukka
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Hi guys,
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; I am having problems building custom boards outside of the Nuttx folder
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; tree. Usually I use the following folder structure.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; |-&amp;amp;gt; apps
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; |-&amp;amp;gt; my-folder
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;
&gt; |-&amp;amp;gt; my-apps
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;
&gt; |-&amp;amp;gt; custom-app
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;
&gt; |-&amp;amp;gt; my-boards
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;
&gt; |-&amp;amp;gt; custom-board
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; |-&amp;amp;gt; nuttx
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; To build my apps I just need to create a symbolic link called external
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; inside apps folder. To create a new custom board I start copying a similar
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; board (e.g nucleo-g431kb) to my-boards folder and make the following changes
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; *remove from defconfig:*
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD="nucleo-g431kb"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; *add on defconfig:*
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD_CUSTOM=y
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; *Rename src/Make.defs to src/Makefile and append the line *
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; include $(TOPDIR)/boards/Board.mk at the end of file.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; This works well for me up to Nuttx version 10.2.0 but now when I try to
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make I got the errors
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Create version.h
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[2]: Entering directory
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Makefile:23: board/Make.defs: No such file or directory
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[2]: *** No rule to make target 'board/Make.defs'.&amp;amp;nbsp; Stop.
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[2]: Leaving directory
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[1]: *** [Makefile:79: context] Error 2
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; make: *** [tools/Unix.mk:425: boards/.context] Error 2
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Does anyone know how to fix this problem?
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Thanks
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;
&gt; Daniel Pereira de Carvalho
&gt; &amp;gt; &amp;amp;gt; &amp;amp;gt;
&gt; &amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Zou,

It very depends on which steps you followed to prepare your custom board
files. So if you just copied one of the board examples then even if you
didn't use common code your board was still relying on
boards/arm/stm32/common/src/Make.defs and
https://github.com/pkarashchenko/incubator-nuttx/blob/8bab629fdd854378f78d5decac51eeeb35cd4751/boards/arm/stm32/common/src/Make.defs#L21
made next lines inaccessible
VPATH += :src
CFLAGS += $(shell $(INCDIR) "$(CC)"
$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src)
DEPPATH += --dep-path src

So after you enabled CONFIG_ARCH_BOARD_COMMON the build started to work
again. If you really would like to make your board independent from common
logic you need to follow the steps that Daniel described initially:
*Rename src/Make.defs to src/Makefile and append the line *
include $(TOPDIR)/boards/Board.mk at the end of file.

I think that you can delete
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += $(shell $(INCDIR) "$(CC)"
$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)

after you rename src/Make.defs to src/Makefile. Anyway if not that should
not give any harm.

Best regards,
Petro

нд, 13 бер. 2022 р. о 02:04 fft <ff...@feedforward.com.cn> пише:

> Hello Petro,
>
>
> Thanks for your help, i didn't use board common code,and my custom board
> defconfig had not enable BOARD_STM32_COMMON config ,but when i tried add
> CONFIG_ARCH_BOARD_COMMON=y to my custom board defconfig according to your
> suggestion, the compile did succeed. Besides, I found that if the
> CONFIG_ARCH_BOARD_COMMON=y was not add to my custom board defconfig,
> there's no symbolic link of my custom board in
> ./nuttx/boards/arm/stm32/common, I think it's this that led to the compile
> error, but i don't known why.
>
>
> my custom board Make.defs begin with include $(TOPDIR)/Make.defs and end
> with
> DEPPATH += --dep-path board
> VPATH += :board
> CFLAGS += $(shell $(INCDIR) "$(CC)"
> $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)
>
>
> Is it correct or not?
>
>
> Best regards,
> Zou
>
>
> ------------------&nbsp;Original&nbsp;------------------
> From: &nbsp;"petro.karashchenko"<petro.karashchenko@gmail.com&gt;;
> Date: &nbsp;Sun, Mar 13, 2022 01:14 AM
> To: &nbsp;"dev"<dev@nuttx.apache.org&gt;;
>
> Subject: &nbsp;Re: Error when building custom board
>
> &nbsp;
>
> Hello Zou,
>
> The https://github.com/apache/incubator-nuttx/pull/5712 unifies board
> common logic usage under a single option ARCH_BOARD_COMMON that is
> introduced instead of per-arch options like BOARD_SAMV7_COMMON or
> BOARD_STM32_COMMON. So most probably if your board defconfig had
> BOARD_STM32_COMMON config enabled you need to replace it with
> ARCH_BOARD_COMMON option. Also while working on
> https://github.com/apache/incubator-nuttx/pull/5712 I found out that
> some boards that didn't have BOARD_STM32_COMMON enabled actually used
> board common code. So the way to fix your build is to remove
> CONFIG_BOARD_STM32_COMMON=y from defconfig if it was present and add
> CONFIG_ARCH_BOARD_COMMON=y to your board defconfig.
>
> Please give me feedback if that works for you. I will add a
> description on how to migrate to a new NuttX release, so users will be
> informed about this breaking change.
>
> Best regards,
> Petro
>
> сб, 12 бер. 2022 р. о 16:10 fft <fft@feedforward.com.cn&gt; пише:
> &gt;
> &gt; Hello Petro,
> &gt;
> &gt;
> &gt;
> &gt; After https://github.com/apache/incubator-nuttx/pull/5712, there's a
> error when building my custom board:
> &gt;
> &gt;
> &gt; make[1]: Entering directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
> &gt; make[2]: Entering directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
> &gt; make[2]: *** No rule to make target 'libboard.a'.&amp;nbsp; Stop.
> &gt; make[2]: Leaving directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
> &gt; Makefile:139: recipe for target 'board/libboard.a' failed
> &gt; make[1]: *** [board/libboard.a] Error 2
> &gt; make[1]: Leaving directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
> &gt; tools/Unix.mk:509: recipe for target 'nuttx' failed
> &gt;
> &gt;
> &gt;
> &gt; My custom board's configs is like this:
> &gt;
> &gt;
> &gt; CONFIG_ARCH="arm"
> &gt; CONFIG_ARCH_BOARD_CUSTOM=y
> &gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../fft/fft-f405"
> &gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> &gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="fft-f405"
> &gt; CONFIG_ARCH_CHIP="stm32"
> &gt; CONFIG_ARCH_CHIP_STM32=y
> &gt; CONFIG_ARCH_CHIP_STM32F405RG=y
> &gt;
> &gt;
> &gt; How should I modify the configuration to adapt to pull #5712 ?
> &gt;
> &gt;
> &gt;
> &gt; Best regards,
> &gt; Zou
> &gt;
> &gt;
> &gt; ------------------&amp;nbsp;Original&amp;nbsp;------------------
> &gt; From: &amp;nbsp;"petro.karashchenko"<petro.karashchenko@gmail.com
> &amp;gt;;
> &gt; Date: &amp;nbsp;Fri, Mar 11, 2022 10:41 PM
> &gt; To: &amp;nbsp;"dev"<dev@nuttx.apache.org&amp;gt;;
> &gt;
> &gt; Subject: &amp;nbsp;Re: Error when building custom board
> &gt;
> &gt; &amp;nbsp;
> &gt;
> &gt; Hello Jukka,
> &gt;
> &gt; Finally I was able to reproduce the situation that you are talking
> &gt; about. The case is that in PX4 environment the path to the board files
> &gt; is hardcoded to $(BOARD_DIR)/src unconditionally, but actually it
> &gt; depends on BOARD_COMMON_DIR value:
> &gt; ifneq ($(BOARD_COMMON_DIR),)
> &gt; ARCH_SRC_BOARD_SYMLINK=$(BOARD_COMMON_DIR)
> &gt; ARCH_SRC_BOARD_BOARD_SYMLINK=$(BOARD_DIR)/src
> &gt; else
> &gt; ARCH_SRC_BOARD_SYMLINK=$(BOARD_DIR)/src
> &gt; endif
> &gt;
> &gt; So the best solution that I can introduce without modification of PX4
> &gt; build system is https://github.com/apache/incubator-nuttx/pull/5715
> &gt <https://github.com/apache/incubator-nuttx/pull/5715&gt>;
> &gt; I do not like it a bit because this leads to a situation that leads to
> &gt; a need to make a distclean each time the ARCH_BOARD_COMMON is changed.
> &gt;
> &gt; Best regards,
> &gt; Petro
> &gt;
> &gt; Best regards,
> &gt; Petro
> &gt;
> &gt; пт, 11 бер. 2022 р. о 11:33 Petro Karashchenko
> &gt; <petro.karashchenko@gmail.com&amp;gt; пише:
> &gt; &amp;gt;
> &gt; &amp;gt; Hello Jukka,
> &gt; &amp;gt;
> &gt; &amp;gt; I'm still in the middle of building a docker image for your
> project.
> &gt; &amp;gt; Currently with slow internet it takes a while.
> &gt; &amp;gt;
> &gt; &amp;gt; But what I see from the error that you report is that
> probably you
> &gt; &amp;gt; applied https://github.com/apache/incubator-nuttx/pull/5712
> while
> &gt; &amp;gt; having https://github.com/apache/incubator-nuttx/pull/5274
> still
> &gt; &amp;gt; reverted.
> &gt; &amp;gt;
> &gt; &amp;gt; I will give feedback as soon as I will replicate your issue
> at my end.
> &gt; &amp;gt;
> &gt; &amp;gt; Best regards,
> &gt; &amp;gt; Petro
> &gt; &amp;gt;
> &gt; &amp;gt; пт, 11 бер. 2022 р. о 08:12 Jukka Laitinen <
> jukka.laitinen@iki.fi&amp;gt; пише:
> &gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt; Hi,
> &gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt; With this patch, all my targets fail with:
> &gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt; Makefile:23: board/Make.defs: No such file or
> directory
> &gt; &amp;gt; &amp;gt; make[3]: *** No rule to make target
> 'board/Make.defs'.&amp;nbsp; Stop.
> &gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt; Should I add some new CONFIGs? Sorry but I don't
> have much time today to
> &gt; &amp;gt; &amp;gt; debug this further
> &gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt; -Jukka
> &gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt; On 10.3.2022 21.00, Petro Karashchenko wrote:
> &gt; &amp;gt; &amp;gt; &amp;gt; Hello Jukka,
> &gt; &amp;gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt; I would like to ask you to try an
> alternative PR
> &gt; &amp;gt; &amp;gt; &amp;gt;
> https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
> &gt; &amp;gt; &amp;gt; &amp;gt; works for you.
> &gt; &amp;gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt; Best regards,
> &gt; &amp;gt; &amp;gt; &amp;gt; Petro
> &gt; &amp;gt; &amp;gt; &amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt; чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen
> <jukka.laitinen@iki.fi&amp;gt; пише:
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; Hi,
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; This fixes the build for me, I
> just leave the
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;
> CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; Thanks,
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; Jukka
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; On 9.3.2022 19.22, Petro
> Karashchenko wrote:
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; Hello Jukka,
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; I was able to localize the
> root cause of the issue. I've created
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;
> https://github.com/apache/incubator-nuttx/pull/5705 to recover things
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; and added a separate
> option that should be explicitly enabled to
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; re-use a board-level
> common code by custom boards users.
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; Please try this change and
> feedback if that solves the problem.
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; Best regards,
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; Petro
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; чт, 3 бер. 2022 р. о 15:33
> Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt; пише:
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi, sorry but I am
> away from computer atm.
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; In the project
> there is "packaging" subdirectory, it contains some docker env, which is
> also used in TII's CI
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; - Jukka
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro Karashchenko
> kirjoitti torstai 3. maaliskuuta 2022:
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hello
> Jukka,
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Do you
> have any steps on how to build or download a docker image that
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; can be
> used to build that project?
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; It takes
> me too much time to get build running.
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Best
> regards,
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; чт, 3 бер.
> 2022 р. о 12:43 Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt; пише:
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> And also note that the commit I mentioned is already reverted in nuttx
> submodule, so you need to put it back in order to re-produce the issue :)
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi, sorry about
> that; you can just remove that submodule, it is not needed to re-produce
> the issue.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - Jukka
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro Karashchenko
> kirjoitti torstai 3. maaliskuuta 2022:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi Jukka,
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I tried to
> replicate your case, but failed with:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; $ git
> submodule update --init --recursive
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Cloning
> into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ERROR:
> Repository not found.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fatal:
> Could not read from remote repository.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Please
> make sure you have the correct access rights
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and the
> repository exists.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fatal:
> clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; path
> '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; failed
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Failed to
> clone 'boards/ssrc/saluki-v1'. Retry scheduled
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Cloning
> into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ERROR:
> Repository not found.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fatal:
> Could not read from remote repository.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Please
> make sure you have the correct access rights
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and the
> repository exists.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fatal:
> clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; path
> '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; failed
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Failed to
> clone 'boards/ssrc/saluki-v1' a second time, aborting
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Best
> regards,
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; чт, 3 бер.
> 2022 р. о 09:34 Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt; пише:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi,
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Maybe I was jumping in to conclusion and the issue is not the same as
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> what I had. I was building PX4, which uses CMake build system, so I am
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> not having any Makefile or Make.defs in my own board directory. Also the
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> platform is not stm or arm, but risc-v.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Anyhow, this is the error which I started getting in my build scripts:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; "
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> ninja: error:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make: *** [Makefile:225: ssrc_icicle_default] Error 1
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; "
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; My
> configs are:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH="risc-v"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD_CUSTOM=y
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> One version, where it fails is available publicly in
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Building "make ssrc_icicle_default". The board files are in
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> boards/ssrc/icicle/nuttx-config and NuttX cloned in
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> platforms/nuttx/Nuttx/nuttx.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I
> didn't yet start looking into it in detail, what goes wrong, just
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> bisected the nuttx and reverted the commit which broke it for me. I need
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to
> look back later to see how to change the off-tree board config to get
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; it
> back online.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Just noticed that the error is somewhat similar, although coming from
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> different build env. But in my case it is likely that I need to adapt
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> the cmake build scripts according to the changes in nuttx.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> -Jukka
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; On
> 3.3.2022 9.37, Petro Karashchenko wrote:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Hello Jukka,
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> So you experience the same problem as Daniel and reverting the commit helps?
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> reuse common code from "nuttx/board/...". I'm using a custom board
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> based on SAME70 and after
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> tree broken. Now the folder structure for "boards/arm/samv7" is the
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> same as in "boards/arm/stm32". Here is what I did to get it back
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> running:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> 1. Synced "custom-board/scripts/Make.defs" with
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> 3. Removed files in my code tree that have exactly the same
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> implementation as files from "boards/arm/samv7/common"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> It seems like Daniel is hitting the same issue, so I expect that
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> should fix the issue without any additional file clean-up.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Please give me feedback if that helps.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Best regards,
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Petro
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt;
> пише:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> HI,
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Not sure what is the correct way to fix this, but I reverted:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> "
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Author: Petro Karashchenko <petro.karashchenko@gmail.com&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Date:&amp;nbsp;&amp;nbsp; Wed Jan 19 11:16:11 2022 +0200
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
> tools: add option to reuse boards common files for custom boards
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
> Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> "
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Petro, what is the proper way to configure this?
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Thanks,
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Jukka
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Hi guys,
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> I am having problems building custom boards outside of the Nuttx folder
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> tree. Usually I use the following folder structure.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> |-&amp;gt; apps
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> |-&amp;gt; my-folder
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
> |-&amp;gt; my-apps
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
> |-&amp;gt; custom-app
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
> |-&amp;gt; my-boards
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
> |-&amp;gt; custom-board
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> |-&amp;gt; nuttx
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> To build my apps I just need to create a symbolic link called external
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> inside apps folder. To create a new custom board I start copying a similar
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> *remove from defconfig:*
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD="nucleo-g431kb"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> *add on defconfig:*
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD_CUSTOM=y
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> *Rename src/Make.defs to src/Makefile and append the line *
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> include $(TOPDIR)/boards/Board.mk at the end of file.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> This works well for me up to Nuttx version 10.2.0 but now when I try to
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make I got the errors
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Create version.h
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[2]: Entering directory
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Makefile:23: board/Make.defs: No such file or directory
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[2]: *** No rule to make target 'board/Make.defs'.&amp;nbsp; Stop.
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[2]: Leaving directory
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[1]: *** [Makefile:79: context] Error 2
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Does anyone know how to fix this problem?
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Thanks
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
> Daniel Pereira de Carvalho
> &gt; &amp;gt; &amp;gt;
> &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;

Re: Error when building custom board

Posted by fft <ff...@feedforward.com.cn>.
Hello Petro,


Thanks for your help, i didn't use board common code,and my custom board defconfig had not enable BOARD_STM32_COMMON config ,but when i tried add CONFIG_ARCH_BOARD_COMMON=y to my custom board defconfig according to your suggestion, the compile did succeed. Besides, I found that if the CONFIG_ARCH_BOARD_COMMON=y was not add to my custom board defconfig, there's no symbolic link of my custom board in ./nuttx/boards/arm/stm32/common, I think it's this that led to the compile error, but i don't known why.


my custom board Make.defs begin with include $(TOPDIR)/Make.defs and end with
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += $(shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)


Is it correct or not?


Best regards,
Zou


------------------&nbsp;Original&nbsp;------------------
From: &nbsp;"petro.karashchenko"<petro.karashchenko@gmail.com&gt;;
Date: &nbsp;Sun, Mar 13, 2022 01:14 AM
To: &nbsp;"dev"<dev@nuttx.apache.org&gt;; 

Subject: &nbsp;Re: Error when building custom board

&nbsp;

Hello Zou,

The https://github.com/apache/incubator-nuttx/pull/5712 unifies board
common logic usage under a single option ARCH_BOARD_COMMON that is
introduced instead of per-arch options like BOARD_SAMV7_COMMON or
BOARD_STM32_COMMON. So most probably if your board defconfig had
BOARD_STM32_COMMON config enabled you need to replace it with
ARCH_BOARD_COMMON option. Also while working on
https://github.com/apache/incubator-nuttx/pull/5712 I found out that
some boards that didn't have BOARD_STM32_COMMON enabled actually used
board common code. So the way to fix your build is to remove
CONFIG_BOARD_STM32_COMMON=y from defconfig if it was present and add
CONFIG_ARCH_BOARD_COMMON=y to your board defconfig.

Please give me feedback if that works for you. I will add a
description on how to migrate to a new NuttX release, so users will be
informed about this breaking change.

Best regards,
Petro

сб, 12 бер. 2022 р. о 16:10 fft <fft@feedforward.com.cn&gt; пише:
&gt;
&gt; Hello Petro,
&gt;
&gt;
&gt;
&gt; After https://github.com/apache/incubator-nuttx/pull/5712, there's a error when building my custom board:
&gt;
&gt;
&gt; make[1]: Entering directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
&gt; make[2]: Entering directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
&gt; make[2]: *** No rule to make target 'libboard.a'.&amp;nbsp; Stop.
&gt; make[2]: Leaving directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
&gt; Makefile:139: recipe for target 'board/libboard.a' failed
&gt; make[1]: *** [board/libboard.a] Error 2
&gt; make[1]: Leaving directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
&gt; tools/Unix.mk:509: recipe for target 'nuttx' failed
&gt;
&gt;
&gt;
&gt; My custom board's configs is like this:
&gt;
&gt;
&gt; CONFIG_ARCH="arm"
&gt; CONFIG_ARCH_BOARD_CUSTOM=y
&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../fft/fft-f405"
&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
&gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="fft-f405"
&gt; CONFIG_ARCH_CHIP="stm32"
&gt; CONFIG_ARCH_CHIP_STM32=y
&gt; CONFIG_ARCH_CHIP_STM32F405RG=y
&gt;
&gt;
&gt; How should I modify the configuration to adapt to pull #5712 ?
&gt;
&gt;
&gt;
&gt; Best regards,
&gt; Zou
&gt;
&gt;
&gt; ------------------&amp;nbsp;Original&amp;nbsp;------------------
&gt; From: &amp;nbsp;"petro.karashchenko"<petro.karashchenko@gmail.com&amp;gt;;
&gt; Date: &amp;nbsp;Fri, Mar 11, 2022 10:41 PM
&gt; To: &amp;nbsp;"dev"<dev@nuttx.apache.org&amp;gt;;
&gt;
&gt; Subject: &amp;nbsp;Re: Error when building custom board
&gt;
&gt; &amp;nbsp;
&gt;
&gt; Hello Jukka,
&gt;
&gt; Finally I was able to reproduce the situation that you are talking
&gt; about. The case is that in PX4 environment the path to the board files
&gt; is hardcoded to $(BOARD_DIR)/src unconditionally, but actually it
&gt; depends on BOARD_COMMON_DIR value:
&gt; ifneq ($(BOARD_COMMON_DIR),)
&gt; ARCH_SRC_BOARD_SYMLINK=$(BOARD_COMMON_DIR)
&gt; ARCH_SRC_BOARD_BOARD_SYMLINK=$(BOARD_DIR)/src
&gt; else
&gt; ARCH_SRC_BOARD_SYMLINK=$(BOARD_DIR)/src
&gt; endif
&gt;
&gt; So the best solution that I can introduce without modification of PX4
&gt; build system is https://github.com/apache/incubator-nuttx/pull/5715
&gt;
&gt; I do not like it a bit because this leads to a situation that leads to
&gt; a need to make a distclean each time the ARCH_BOARD_COMMON is changed.
&gt;
&gt; Best regards,
&gt; Petro
&gt;
&gt; Best regards,
&gt; Petro
&gt;
&gt; пт, 11 бер. 2022 р. о 11:33 Petro Karashchenko
&gt; <petro.karashchenko@gmail.com&amp;gt; пише:
&gt; &amp;gt;
&gt; &amp;gt; Hello Jukka,
&gt; &amp;gt;
&gt; &amp;gt; I'm still in the middle of building a docker image for your project.
&gt; &amp;gt; Currently with slow internet it takes a while.
&gt; &amp;gt;
&gt; &amp;gt; But what I see from the error that you report is that probably you
&gt; &amp;gt; applied https://github.com/apache/incubator-nuttx/pull/5712 while
&gt; &amp;gt; having https://github.com/apache/incubator-nuttx/pull/5274 still
&gt; &amp;gt; reverted.
&gt; &amp;gt;
&gt; &amp;gt; I will give feedback as soon as I will replicate your issue at my end.
&gt; &amp;gt;
&gt; &amp;gt; Best regards,
&gt; &amp;gt; Petro
&gt; &amp;gt;
&gt; &amp;gt; пт, 11 бер. 2022 р. о 08:12 Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt; пише:
&gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt; Hi,
&gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt; With this patch, all my targets fail with:
&gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt; Makefile:23: board/Make.defs: No such file or directory
&gt; &amp;gt; &amp;gt; make[3]: *** No rule to make target 'board/Make.defs'.&amp;nbsp; Stop.
&gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt; Should I add some new CONFIGs? Sorry but I don't have much time today to
&gt; &amp;gt; &amp;gt; debug this further
&gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt; -Jukka
&gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt; On 10.3.2022 21.00, Petro Karashchenko wrote:
&gt; &amp;gt; &amp;gt; &amp;gt; Hello Jukka,
&gt; &amp;gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt; I would like to ask you to try an alternative PR
&gt; &amp;gt; &amp;gt; &amp;gt; https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
&gt; &amp;gt; &amp;gt; &amp;gt; works for you.
&gt; &amp;gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt; Best regards,
&gt; &amp;gt; &amp;gt; &amp;gt; Petro
&gt; &amp;gt; &amp;gt; &amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt; чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt; пише:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; Hi,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; This fixes the build for me, I just leave the
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; Thanks,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; Jukka
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; On 9.3.2022 19.22, Petro Karashchenko wrote:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; Hello Jukka,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; I was able to localize the root cause of the issue. I've created
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; https://github.com/apache/incubator-nuttx/pull/5705 to recover things
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; and added a separate option that should be explicitly enabled to
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; re-use a board-level common code by custom boards users.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; Please try this change and feedback if that solves the problem.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; Best regards,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; Petro
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt; пише:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi, sorry but I am away from computer atm.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; - Jukka
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hello Jukka,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Do you have any steps on how to build or download a docker image that
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; can be used to build that project?
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; It takes me too much time to get build running.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Best regards,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt; пише:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - Jukka
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi Jukka,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I tried to replicate your case, but failed with:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; $ git submodule update --init --recursive
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ERROR: Repository not found.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fatal: Could not read from remote repository.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Please make sure you have the correct access rights
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and the repository exists.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; failed
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ERROR: Repository not found.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fatal: Could not read from remote repository.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Please make sure you have the correct access rights
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and the repository exists.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; failed
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Best regards,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt; пише:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Maybe I was jumping in to conclusion and the issue is not the same as
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; what I had. I was building PX4, which uses CMake build system, so I am
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; not having any Makefile or Make.defs in my own board directory. Also the
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; platform is not stm or arm, but risc-v.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Anyhow, this is the error which I started getting in my build scripts:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; "
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ninja: error:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make: *** [Makefile:225: ssrc_icicle_default] Error 1
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; "
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; My configs are:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH="risc-v"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD_CUSTOM=y
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; One version, where it fails is available publicly in
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Building "make ssrc_icicle_default". The board files are in
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; boards/ssrc/icicle/nuttx-config and NuttX cloned in
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; platforms/nuttx/Nuttx/nuttx.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I didn't yet start looking into it in detail, what goes wrong, just
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bisected the nuttx and reverted the commit which broke it for me. I need
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to look back later to see how to change the off-tree board config to get
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; it back online.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Just noticed that the error is somewhat similar, although coming from
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; different build env. But in my case it is likely that I need to adapt
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the cmake build scripts according to the changes in nuttx.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; -Jukka
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; On 3.3.2022 9.37, Petro Karashchenko wrote:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hello Jukka,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; So you experience the same problem as Daniel and reverting the commit helps?
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; reuse common code from "nuttx/board/...". I'm using a custom board
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; based on SAME70 and after
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; https://github.com/apache/incubator-nuttx/pull/4981 I found my code
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; tree broken. Now the folder structure for "boards/arm/samv7" is the
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; same as in "boards/arm/stm32". Here is what I did to get it back
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; running:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 1. Synced "custom-board/scripts/Make.defs" with
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; "boards/arm/samv7/same70-xplained/scripts/Make.defs"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 3. Removed files in my code tree that have exactly the same
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; implementation as files from "boards/arm/samv7/common"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; It seems like Daniel is hitting the same issue, so I expect that
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; should fix the issue without any additional file clean-up.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Please give me feedback if that helps.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Best regards,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <jukka.laitinen@iki.fi&amp;gt; пише:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; HI,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Not sure what is the correct way to fix this, but I reverted:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; "
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Author: Petro Karashchenko <petro.karashchenko@gmail.com&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Date:&amp;nbsp;&amp;nbsp; Wed Jan 19 11:16:11 2022 +0200
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tools: add option to reuse boards common files for custom boards
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; "
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Petro, what is the proper way to configure this?
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Thanks,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Jukka
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi guys,
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I am having problems building custom boards outside of the Nuttx folder
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; tree. Usually I use the following folder structure.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; |-&amp;gt; apps
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; |-&amp;gt; my-folder
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |-&amp;gt; my-apps
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |-&amp;gt; custom-app
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |-&amp;gt; my-boards
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |-&amp;gt; custom-board
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; |-&amp;gt; nuttx
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; To build my apps I just need to create a symbolic link called external
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; inside apps folder. To create a new custom board I start copying a similar
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; board (e.g nucleo-g431kb) to my-boards folder and make the following changes
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *remove from defconfig:*
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD="nucleo-g431kb"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *add on defconfig:*
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD_CUSTOM=y
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *Rename src/Make.defs to src/Makefile and append the line *
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; include $(TOPDIR)/boards/Board.mk at the end of file.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; This works well for me up to Nuttx version 10.2.0 but now when I try to
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make I got the errors
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Create version.h
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[2]: Entering directory
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Makefile:23: board/Make.defs: No such file or directory
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[2]: *** No rule to make target 'board/Make.defs'.&amp;nbsp; Stop.
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[2]: Leaving directory
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[1]: *** [Makefile:79: context] Error 2
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make: *** [tools/Unix.mk:425: boards/.context] Error 2
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Does anyone know how to fix this problem?
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Thanks
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Daniel Pereira de Carvalho
&gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Zou,

The https://github.com/apache/incubator-nuttx/pull/5712 unifies board
common logic usage under a single option ARCH_BOARD_COMMON that is
introduced instead of per-arch options like BOARD_SAMV7_COMMON or
BOARD_STM32_COMMON. So most probably if your board defconfig had
BOARD_STM32_COMMON config enabled you need to replace it with
ARCH_BOARD_COMMON option. Also while working on
https://github.com/apache/incubator-nuttx/pull/5712 I found out that
some boards that didn't have BOARD_STM32_COMMON enabled actually used
board common code. So the way to fix your build is to remove
CONFIG_BOARD_STM32_COMMON=y from defconfig if it was present and add
CONFIG_ARCH_BOARD_COMMON=y to your board defconfig.

Please give me feedback if that works for you. I will add a
description on how to migrate to a new NuttX release, so users will be
informed about this breaking change.

Best regards,
Petro

сб, 12 бер. 2022 р. о 16:10 fft <ff...@feedforward.com.cn> пише:
>
> Hello Petro,
>
>
>
> After https://github.com/apache/incubator-nuttx/pull/5712, there's a error when building my custom board:
>
>
> make[1]: Entering directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
> make[2]: Entering directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
> make[2]: *** No rule to make target 'libboard.a'.&nbsp; Stop.
> make[2]: Leaving directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
> Makefile:139: recipe for target 'board/libboard.a' failed
> make[1]: *** [board/libboard.a] Error 2
> make[1]: Leaving directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
> tools/Unix.mk:509: recipe for target 'nuttx' failed
>
>
>
> My custom board's configs is like this:
>
>
> CONFIG_ARCH="arm"
> CONFIG_ARCH_BOARD_CUSTOM=y
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../fft/fft-f405"
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> CONFIG_ARCH_BOARD_CUSTOM_NAME="fft-f405"
> CONFIG_ARCH_CHIP="stm32"
> CONFIG_ARCH_CHIP_STM32=y
> CONFIG_ARCH_CHIP_STM32F405RG=y
>
>
> How should I modify the configuration to adapt to pull #5712 ?
>
>
>
> Best regards,
> Zou
>
>
> ------------------&nbsp;Original&nbsp;------------------
> From: &nbsp;"petro.karashchenko"<petro.karashchenko@gmail.com&gt;;
> Date: &nbsp;Fri, Mar 11, 2022 10:41 PM
> To: &nbsp;"dev"<dev@nuttx.apache.org&gt;;
>
> Subject: &nbsp;Re: Error when building custom board
>
> &nbsp;
>
> Hello Jukka,
>
> Finally I was able to reproduce the situation that you are talking
> about. The case is that in PX4 environment the path to the board files
> is hardcoded to $(BOARD_DIR)/src unconditionally, but actually it
> depends on BOARD_COMMON_DIR value:
> ifneq ($(BOARD_COMMON_DIR),)
> ARCH_SRC_BOARD_SYMLINK=$(BOARD_COMMON_DIR)
> ARCH_SRC_BOARD_BOARD_SYMLINK=$(BOARD_DIR)/src
> else
> ARCH_SRC_BOARD_SYMLINK=$(BOARD_DIR)/src
> endif
>
> So the best solution that I can introduce without modification of PX4
> build system is https://github.com/apache/incubator-nuttx/pull/5715
>
> I do not like it a bit because this leads to a situation that leads to
> a need to make a distclean each time the ARCH_BOARD_COMMON is changed.
>
> Best regards,
> Petro
>
> Best regards,
> Petro
>
> пт, 11 бер. 2022 р. о 11:33 Petro Karashchenko
> <petro.karashchenko@gmail.com&gt; пише:
> &gt;
> &gt; Hello Jukka,
> &gt;
> &gt; I'm still in the middle of building a docker image for your project.
> &gt; Currently with slow internet it takes a while.
> &gt;
> &gt; But what I see from the error that you report is that probably you
> &gt; applied https://github.com/apache/incubator-nuttx/pull/5712 while
> &gt; having https://github.com/apache/incubator-nuttx/pull/5274 still
> &gt; reverted.
> &gt;
> &gt; I will give feedback as soon as I will replicate your issue at my end.
> &gt;
> &gt; Best regards,
> &gt; Petro
> &gt;
> &gt; пт, 11 бер. 2022 р. о 08:12 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
> &gt; &gt;
> &gt; &gt; Hi,
> &gt; &gt;
> &gt; &gt; With this patch, all my targets fail with:
> &gt; &gt;
> &gt; &gt; Makefile:23: board/Make.defs: No such file or directory
> &gt; &gt; make[3]: *** No rule to make target 'board/Make.defs'.&nbsp; Stop.
> &gt; &gt;
> &gt; &gt; Should I add some new CONFIGs? Sorry but I don't have much time today to
> &gt; &gt; debug this further
> &gt; &gt;
> &gt; &gt; -Jukka
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; On 10.3.2022 21.00, Petro Karashchenko wrote:
> &gt; &gt; &gt; Hello Jukka,
> &gt; &gt; &gt;
> &gt; &gt; &gt; I would like to ask you to try an alternative PR
> &gt; &gt; &gt; https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
> &gt; &gt; &gt; works for you.
> &gt; &gt; &gt;
> &gt; &gt; &gt; Best regards,
> &gt; &gt; &gt; Petro
> &gt; &gt; &gt;
> &gt; &gt; &gt; чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
> &gt; &gt; &gt;&gt; Hi,
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; This fixes the build for me, I just leave the
> &gt; &gt; &gt;&gt; CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; Thanks,
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; Jukka
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; On 9.3.2022 19.22, Petro Karashchenko wrote:
> &gt; &gt; &gt;&gt;&gt; Hello Jukka,
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; I was able to localize the root cause of the issue. I've created
> &gt; &gt; &gt;&gt;&gt; https://github.com/apache/incubator-nuttx/pull/5705 to recover things
> &gt; &gt; &gt;&gt;&gt; and added a separate option that should be explicitly enabled to
> &gt; &gt; &gt;&gt;&gt; re-use a board-level common code by custom boards users.
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; Please try this change and feedback if that solves the problem.
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; Best regards,
> &gt; &gt; &gt;&gt;&gt; Petro
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
> &gt; &gt; &gt;&gt;&gt;&gt; Hi, sorry but I am away from computer atm.
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt; In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt; - Jukka
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt; Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt; Hello Jukka,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt; Do you have any steps on how to build or download a docker image that
> &gt; &gt; &gt;&gt;&gt;&gt;&gt; can be used to build that project?
> &gt; &gt; &gt;&gt;&gt;&gt;&gt; It takes me too much time to get build running.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt; Best regards,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt; Petro
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt; чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt; And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt; Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; - Jukka
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi Jukka,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I tried to replicate your case, but failed with:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; $ git submodule update --init --recursive
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ERROR: Repository not found.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; fatal: Could not read from remote repository.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Please make sure you have the correct access rights
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; and the repository exists.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; failed
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ERROR: Repository not found.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; fatal: Could not read from remote repository.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Please make sure you have the correct access rights
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; and the repository exists.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; failed
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Best regards,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Petro
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Maybe I was jumping in to conclusion and the issue is not the same as
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; what I had. I was building PX4, which uses CMake build system, so I am
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; not having any Makefile or Make.defs in my own board directory. Also the
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; platform is not stm or arm, but risc-v.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Anyhow, this is the error which I started getting in my build scripts:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ninja: error:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make: *** [Makefile:225: ssrc_icicle_default] Error 1
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; My configs are:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH="risc-v"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM=y
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; One version, where it fails is available publicly in
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Building "make ssrc_icicle_default". The board files are in
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; boards/ssrc/icicle/nuttx-config and NuttX cloned in
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; platforms/nuttx/Nuttx/nuttx.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I didn't yet start looking into it in detail, what goes wrong, just
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; bisected the nuttx and reverted the commit which broke it for me. I need
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; to look back later to see how to change the off-tree board config to get
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; it back online.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Just noticed that the error is somewhat similar, although coming from
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; different build env. But in my case it is likely that I need to adapt
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; the cmake build scripts according to the changes in nuttx.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; -Jukka
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On 3.3.2022 9.37, Petro Karashchenko wrote:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hello Jukka,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; So you experience the same problem as Daniel and reverting the commit helps?
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; reuse common code from "nuttx/board/...". I'm using a custom board
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; based on SAME70 and after
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; tree broken. Now the folder structure for "boards/arm/samv7" is the
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; same as in "boards/arm/stm32". Here is what I did to get it back
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; running:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 1. Synced "custom-board/scripts/Make.defs" with
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 3. Removed files in my code tree that have exactly the same
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; implementation as files from "boards/arm/samv7/common"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; It seems like Daniel is hitting the same issue, so I expect that
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; should fix the issue without any additional file clean-up.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Please give me feedback if that helps.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Best regards,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Petro
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; HI,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Not sure what is the correct way to fix this, but I reverted:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Author: Petro Karashchenko <petro.karashchenko@gmail.com&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Date:&nbsp;&nbsp; Wed Jan 19 11:16:11 2022 +0200
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tools: add option to reuse boards common files for custom boards
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Petro, what is the proper way to configure this?
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Jukka
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi guys,
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I am having problems building custom boards outside of the Nuttx folder
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; tree. Usually I use the following folder structure.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; |-&gt; apps
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; |-&gt; my-folder
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |-&gt; my-apps
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |-&gt; custom-app
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |-&gt; my-boards
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |-&gt; custom-board
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; |-&gt; nuttx
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; To build my apps I just need to create a symbolic link called external
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; inside apps folder. To create a new custom board I start copying a similar
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; *remove from defconfig:*
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD="nucleo-g431kb"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; *add on defconfig:*
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM=y
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; *Rename src/Make.defs to src/Makefile and append the line *
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; include $(TOPDIR)/boards/Board.mk at the end of file.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; This works well for me up to Nuttx version 10.2.0 but now when I try to
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make I got the errors
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Create version.h
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[2]: Entering directory
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Makefile:23: board/Make.defs: No such file or directory
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[2]: *** No rule to make target 'board/Make.defs'.&nbsp; Stop.
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[2]: Leaving directory
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: *** [Makefile:79: context] Error 2
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make: *** [tools/Unix.mk:425: boards/.context] Error 2
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Does anyone know how to fix this problem?
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Daniel Pereira de Carvalho
> &gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;

Re: Error when building custom board

Posted by fft <ff...@feedforward.com.cn>.
Hello Petro,



After https://github.com/apache/incubator-nuttx/pull/5712, there's a error when building my custom board:


make[1]: Entering directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
make[2]: Entering directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
make[2]: *** No rule to make target 'libboard.a'.&nbsp; Stop.
make[2]: Leaving directory '/home/zouboan/G/NuttX/fft/fft-f405/src'
Makefile:139: recipe for target 'board/libboard.a' failed
make[1]: *** [board/libboard.a] Error 2
make[1]: Leaving directory '/home/zouboan/G/NuttX/nuttx/arch/arm/src'
tools/Unix.mk:509: recipe for target 'nuttx' failed



My custom board's configs is like this:


CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../fft/fft-f405"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="fft-f405"
CONFIG_ARCH_CHIP="stm32"
CONFIG_ARCH_CHIP_STM32=y
CONFIG_ARCH_CHIP_STM32F405RG=y


How should I modify the configuration to adapt to pull #5712 ?



Best regards,
Zou


------------------&nbsp;Original&nbsp;------------------
From: &nbsp;"petro.karashchenko"<petro.karashchenko@gmail.com&gt;;
Date: &nbsp;Fri, Mar 11, 2022 10:41 PM
To: &nbsp;"dev"<dev@nuttx.apache.org&gt;; 

Subject: &nbsp;Re: Error when building custom board

&nbsp;

Hello Jukka,

Finally I was able to reproduce the situation that you are talking
about. The case is that in PX4 environment the path to the board files
is hardcoded to $(BOARD_DIR)/src unconditionally, but actually it
depends on BOARD_COMMON_DIR value:
ifneq ($(BOARD_COMMON_DIR),)
ARCH_SRC_BOARD_SYMLINK=$(BOARD_COMMON_DIR)
ARCH_SRC_BOARD_BOARD_SYMLINK=$(BOARD_DIR)/src
else
ARCH_SRC_BOARD_SYMLINK=$(BOARD_DIR)/src
endif

So the best solution that I can introduce without modification of PX4
build system is https://github.com/apache/incubator-nuttx/pull/5715

I do not like it a bit because this leads to a situation that leads to
a need to make a distclean each time the ARCH_BOARD_COMMON is changed.

Best regards,
Petro

Best regards,
Petro

пт, 11 бер. 2022 р. о 11:33 Petro Karashchenko
<petro.karashchenko@gmail.com&gt; пише:
&gt;
&gt; Hello Jukka,
&gt;
&gt; I'm still in the middle of building a docker image for your project.
&gt; Currently with slow internet it takes a while.
&gt;
&gt; But what I see from the error that you report is that probably you
&gt; applied https://github.com/apache/incubator-nuttx/pull/5712 while
&gt; having https://github.com/apache/incubator-nuttx/pull/5274 still
&gt; reverted.
&gt;
&gt; I will give feedback as soon as I will replicate your issue at my end.
&gt;
&gt; Best regards,
&gt; Petro
&gt;
&gt; пт, 11 бер. 2022 р. о 08:12 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
&gt; &gt;
&gt; &gt; Hi,
&gt; &gt;
&gt; &gt; With this patch, all my targets fail with:
&gt; &gt;
&gt; &gt; Makefile:23: board/Make.defs: No such file or directory
&gt; &gt; make[3]: *** No rule to make target 'board/Make.defs'.&nbsp; Stop.
&gt; &gt;
&gt; &gt; Should I add some new CONFIGs? Sorry but I don't have much time today to
&gt; &gt; debug this further
&gt; &gt;
&gt; &gt; -Jukka
&gt; &gt;
&gt; &gt;
&gt; &gt; On 10.3.2022 21.00, Petro Karashchenko wrote:
&gt; &gt; &gt; Hello Jukka,
&gt; &gt; &gt;
&gt; &gt; &gt; I would like to ask you to try an alternative PR
&gt; &gt; &gt; https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
&gt; &gt; &gt; works for you.
&gt; &gt; &gt;
&gt; &gt; &gt; Best regards,
&gt; &gt; &gt; Petro
&gt; &gt; &gt;
&gt; &gt; &gt; чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
&gt; &gt; &gt;&gt; Hi,
&gt; &gt; &gt;&gt;
&gt; &gt; &gt;&gt; This fixes the build for me, I just leave the
&gt; &gt; &gt;&gt; CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
&gt; &gt; &gt;&gt;
&gt; &gt; &gt;&gt; Thanks,
&gt; &gt; &gt;&gt;
&gt; &gt; &gt;&gt; Jukka
&gt; &gt; &gt;&gt;
&gt; &gt; &gt;&gt; On 9.3.2022 19.22, Petro Karashchenko wrote:
&gt; &gt; &gt;&gt;&gt; Hello Jukka,
&gt; &gt; &gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt; I was able to localize the root cause of the issue. I've created
&gt; &gt; &gt;&gt;&gt; https://github.com/apache/incubator-nuttx/pull/5705 to recover things
&gt; &gt; &gt;&gt;&gt; and added a separate option that should be explicitly enabled to
&gt; &gt; &gt;&gt;&gt; re-use a board-level common code by custom boards users.
&gt; &gt; &gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt; Please try this change and feedback if that solves the problem.
&gt; &gt; &gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt; Best regards,
&gt; &gt; &gt;&gt;&gt; Petro
&gt; &gt; &gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt; чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
&gt; &gt; &gt;&gt;&gt;&gt; Hi, sorry but I am away from computer atm.
&gt; &gt; &gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt; In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI
&gt; &gt; &gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt; - Jukka
&gt; &gt; &gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt; Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
&gt; &gt; &gt;&gt;&gt;&gt;&gt; Hello Jukka,
&gt; &gt; &gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt; Do you have any steps on how to build or download a docker image that
&gt; &gt; &gt;&gt;&gt;&gt;&gt; can be used to build that project?
&gt; &gt; &gt;&gt;&gt;&gt;&gt; It takes me too much time to get build running.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt; Best regards,
&gt; &gt; &gt;&gt;&gt;&gt;&gt; Petro
&gt; &gt; &gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt; чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt; And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt; Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; - Jukka
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi Jukka,
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I tried to replicate your case, but failed with:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; $ git submodule update --init --recursive
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ERROR: Repository not found.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; fatal: Could not read from remote repository.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Please make sure you have the correct access rights
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; and the repository exists.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; failed
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ERROR: Repository not found.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; fatal: Could not read from remote repository.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Please make sure you have the correct access rights
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; and the repository exists.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; failed
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Best regards,
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Petro
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi,
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Maybe I was jumping in to conclusion and the issue is not the same as
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; what I had. I was building PX4, which uses CMake build system, so I am
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; not having any Makefile or Make.defs in my own board directory. Also the
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; platform is not stm or arm, but risc-v.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Anyhow, this is the error which I started getting in my build scripts:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ninja: error:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make: *** [Makefile:225: ssrc_icicle_default] Error 1
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; My configs are:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH="risc-v"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM=y
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; One version, where it fails is available publicly in
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Building "make ssrc_icicle_default". The board files are in
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; boards/ssrc/icicle/nuttx-config and NuttX cloned in
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; platforms/nuttx/Nuttx/nuttx.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I didn't yet start looking into it in detail, what goes wrong, just
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; bisected the nuttx and reverted the commit which broke it for me. I need
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; to look back later to see how to change the off-tree board config to get
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; it back online.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Just noticed that the error is somewhat similar, although coming from
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; different build env. But in my case it is likely that I need to adapt
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; the cmake build scripts according to the changes in nuttx.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; -Jukka
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On 3.3.2022 9.37, Petro Karashchenko wrote:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hello Jukka,
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; So you experience the same problem as Daniel and reverting the commit helps?
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; reuse common code from "nuttx/board/...". I'm using a custom board
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; based on SAME70 and after
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; https://github.com/apache/incubator-nuttx/pull/4981 I found my code
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; tree broken. Now the folder structure for "boards/arm/samv7" is the
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; same as in "boards/arm/stm32". Here is what I did to get it back
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; running:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 1. Synced "custom-board/scripts/Make.defs" with
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "boards/arm/samv7/same70-xplained/scripts/Make.defs"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 3. Removed files in my code tree that have exactly the same
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; implementation as files from "boards/arm/samv7/common"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; It seems like Daniel is hitting the same issue, so I expect that
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; should fix the issue without any additional file clean-up.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Please give me feedback if that helps.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Best regards,
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Petro
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <jukka.laitinen@iki.fi&gt; пише:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; HI,
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Not sure what is the correct way to fix this, but I reverted:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Author: Petro Karashchenko <petro.karashchenko@gmail.com&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Date:&nbsp;&nbsp; Wed Jan 19 11:16:11 2022 +0200
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tools: add option to reuse boards common files for custom boards
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; "
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Petro, what is the proper way to configure this?
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks,
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Jukka
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi guys,
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I am having problems building custom boards outside of the Nuttx folder
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; tree. Usually I use the following folder structure.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; |-&gt; apps
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; |-&gt; my-folder
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |-&gt; my-apps
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |-&gt; custom-app
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |-&gt; my-boards
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |-&gt; custom-board
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; |-&gt; nuttx
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; To build my apps I just need to create a symbolic link called external
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; inside apps folder. To create a new custom board I start copying a similar
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; board (e.g nucleo-g431kb) to my-boards folder and make the following changes
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; *remove from defconfig:*
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD="nucleo-g431kb"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; *add on defconfig:*
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM=y
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; *Rename src/Make.defs to src/Makefile and append the line *
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; include $(TOPDIR)/boards/Board.mk at the end of file.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; This works well for me up to Nuttx version 10.2.0 but now when I try to
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make I got the errors
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Create version.h
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[2]: Entering directory
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Makefile:23: board/Make.defs: No such file or directory
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[2]: *** No rule to make target 'board/Make.defs'.&nbsp; Stop.
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[2]: Leaving directory
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: *** [Makefile:79: context] Error 2
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; make: *** [tools/Unix.mk:425: boards/.context] Error 2
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Does anyone know how to fix this problem?
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Daniel Pereira de Carvalho
&gt; &gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Jukka,

Finally I was able to reproduce the situation that you are talking
about. The case is that in PX4 environment the path to the board files
is hardcoded to $(BOARD_DIR)/src unconditionally, but actually it
depends on BOARD_COMMON_DIR value:
ifneq ($(BOARD_COMMON_DIR),)
ARCH_SRC_BOARD_SYMLINK=$(BOARD_COMMON_DIR)
ARCH_SRC_BOARD_BOARD_SYMLINK=$(BOARD_DIR)/src
else
ARCH_SRC_BOARD_SYMLINK=$(BOARD_DIR)/src
endif

So the best solution that I can introduce without modification of PX4
build system is https://github.com/apache/incubator-nuttx/pull/5715

I do not like it a bit because this leads to a situation that leads to
a need to make a distclean each time the ARCH_BOARD_COMMON is changed.

Best regards,
Petro

Best regards,
Petro

пт, 11 бер. 2022 р. о 11:33 Petro Karashchenko
<pe...@gmail.com> пише:
>
> Hello Jukka,
>
> I'm still in the middle of building a docker image for your project.
> Currently with slow internet it takes a while.
>
> But what I see from the error that you report is that probably you
> applied https://github.com/apache/incubator-nuttx/pull/5712 while
> having https://github.com/apache/incubator-nuttx/pull/5274 still
> reverted.
>
> I will give feedback as soon as I will replicate your issue at my end.
>
> Best regards,
> Petro
>
> пт, 11 бер. 2022 р. о 08:12 Jukka Laitinen <ju...@iki.fi> пише:
> >
> > Hi,
> >
> > With this patch, all my targets fail with:
> >
> > Makefile:23: board/Make.defs: No such file or directory
> > make[3]: *** No rule to make target 'board/Make.defs'.  Stop.
> >
> > Should I add some new CONFIGs? Sorry but I don't have much time today to
> > debug this further
> >
> > -Jukka
> >
> >
> > On 10.3.2022 21.00, Petro Karashchenko wrote:
> > > Hello Jukka,
> > >
> > > I would like to ask you to try an alternative PR
> > > https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
> > > works for you.
> > >
> > > Best regards,
> > > Petro
> > >
> > > чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen <ju...@iki.fi> пише:
> > >> Hi,
> > >>
> > >> This fixes the build for me, I just leave the
> > >> CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
> > >>
> > >> Thanks,
> > >>
> > >> Jukka
> > >>
> > >> On 9.3.2022 19.22, Petro Karashchenko wrote:
> > >>> Hello Jukka,
> > >>>
> > >>> I was able to localize the root cause of the issue. I've created
> > >>> https://github.com/apache/incubator-nuttx/pull/5705 to recover things
> > >>> and added a separate option that should be explicitly enabled to
> > >>> re-use a board-level common code by custom boards users.
> > >>>
> > >>> Please try this change and feedback if that solves the problem.
> > >>>
> > >>> Best regards,
> > >>> Petro
> > >>>
> > >>> чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <ju...@iki.fi> пише:
> > >>>> Hi, sorry but I am away from computer atm.
> > >>>>
> > >>>> In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI
> > >>>>
> > >>>> - Jukka
> > >>>>
> > >>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> > >>>>> Hello Jukka,
> > >>>>>
> > >>>>> Do you have any steps on how to build or download a docker image that
> > >>>>> can be used to build that project?
> > >>>>> It takes me too much time to get build running.
> > >>>>>
> > >>>>> Best regards,
> > >>>>> Petro
> > >>>>>
> > >>>>> чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi> пише:
> > >>>>>> And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
> > >>>>>>
> > >>>>>>
> > >>>>>> Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> > >>>>>>> Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
> > >>>>>>>
> > >>>>>>> - Jukka
> > >>>>>>>
> > >>>>>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> > >>>>>>>> Hi Jukka,
> > >>>>>>>>
> > >>>>>>>> I tried to replicate your case, but failed with:
> > >>>>>>>> $ git submodule update --init --recursive
> > >>>>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > >>>>>>>> ERROR: Repository not found.
> > >>>>>>>> fatal: Could not read from remote repository.
> > >>>>>>>>
> > >>>>>>>> Please make sure you have the correct access rights
> > >>>>>>>> and the repository exists.
> > >>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > >>>>>>>> path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > >>>>>>>> failed
> > >>>>>>>> Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> > >>>>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > >>>>>>>> ERROR: Repository not found.
> > >>>>>>>> fatal: Could not read from remote repository.
> > >>>>>>>>
> > >>>>>>>> Please make sure you have the correct access rights
> > >>>>>>>> and the repository exists.
> > >>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > >>>>>>>> path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > >>>>>>>> failed
> > >>>>>>>> Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> > >>>>>>>>
> > >>>>>>>> Best regards,
> > >>>>>>>> Petro
> > >>>>>>>>
> > >>>>>>>> чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
> > >>>>>>>>> Hi,
> > >>>>>>>>>
> > >>>>>>>>> Maybe I was jumping in to conclusion and the issue is not the same as
> > >>>>>>>>> what I had. I was building PX4, which uses CMake build system, so I am
> > >>>>>>>>> not having any Makefile or Make.defs in my own board directory. Also the
> > >>>>>>>>> platform is not stm or arm, but risc-v.
> > >>>>>>>>>
> > >>>>>>>>> Anyhow, this is the error which I started getting in my build scripts:
> > >>>>>>>>>
> > >>>>>>>>> "
> > >>>>>>>>>
> > >>>>>>>>> ninja: error:
> > >>>>>>>>> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > >>>>>>>>> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > >>>>>>>>> make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > >>>>>>>>> "
> > >>>>>>>>>
> > >>>>>>>>> My configs are:
> > >>>>>>>>>
> > >>>>>>>>> CONFIG_ARCH="risc-v"
> > >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
> > >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > >>>>>>>>>
> > >>>>>>>>> One version, where it fails is available publicly in
> > >>>>>>>>>
> > >>>>>>>>> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > >>>>>>>>>
> > >>>>>>>>> Building "make ssrc_icicle_default". The board files are in
> > >>>>>>>>> boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > >>>>>>>>> platforms/nuttx/Nuttx/nuttx.
> > >>>>>>>>>
> > >>>>>>>>> I didn't yet start looking into it in detail, what goes wrong, just
> > >>>>>>>>> bisected the nuttx and reverted the commit which broke it for me. I need
> > >>>>>>>>> to look back later to see how to change the off-tree board config to get
> > >>>>>>>>> it back online.
> > >>>>>>>>>
> > >>>>>>>>> Just noticed that the error is somewhat similar, although coming from
> > >>>>>>>>> different build env. But in my case it is likely that I need to adapt
> > >>>>>>>>> the cmake build scripts according to the changes in nuttx.
> > >>>>>>>>>
> > >>>>>>>>> -Jukka
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>> On 3.3.2022 9.37, Petro Karashchenko wrote:
> > >>>>>>>>>> Hello Jukka,
> > >>>>>>>>>>
> > >>>>>>>>>> So you experience the same problem as Daniel and reverting the commit helps?
> > >>>>>>>>>>
> > >>>>>>>>>> Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > >>>>>>>>>> reuse common code from "nuttx/board/...". I'm using a custom board
> > >>>>>>>>>> based on SAME70 and after
> > >>>>>>>>>> https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > >>>>>>>>>> tree broken. Now the folder structure for "boards/arm/samv7" is the
> > >>>>>>>>>> same as in "boards/arm/stm32". Here is what I did to get it back
> > >>>>>>>>>> running:
> > >>>>>>>>>> 1. Synced "custom-board/scripts/Make.defs" with
> > >>>>>>>>>> "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > >>>>>>>>>> 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > >>>>>>>>>> and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > >>>>>>>>>> 3. Removed files in my code tree that have exactly the same
> > >>>>>>>>>> implementation as files from "boards/arm/samv7/common"
> > >>>>>>>>>>
> > >>>>>>>>>> It seems like Daniel is hitting the same issue, so I expect that
> > >>>>>>>>>> renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > >>>>>>>>>> should fix the issue without any additional file clean-up.
> > >>>>>>>>>> Please give me feedback if that helps.
> > >>>>>>>>>>
> > >>>>>>>>>> Best regards,
> > >>>>>>>>>> Petro
> > >>>>>>>>>>
> > >>>>>>>>>> чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > >>>>>>>>>>> HI,
> > >>>>>>>>>>>
> > >>>>>>>>>>> Not sure what is the correct way to fix this, but I reverted:
> > >>>>>>>>>>>
> > >>>>>>>>>>> "
> > >>>>>>>>>>>
> > >>>>>>>>>>> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > >>>>>>>>>>> Author: Petro Karashchenko <pe...@gmail.com>
> > >>>>>>>>>>> Date:   Wed Jan 19 11:16:11 2022 +0200
> > >>>>>>>>>>>
> > >>>>>>>>>>>         tools: add option to reuse boards common files for custom boards
> > >>>>>>>>>>>
> > >>>>>>>>>>>         Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > >>>>>>>>>>> "
> > >>>>>>>>>>>
> > >>>>>>>>>>> Petro, what is the proper way to configure this?
> > >>>>>>>>>>>
> > >>>>>>>>>>> Thanks,
> > >>>>>>>>>>>
> > >>>>>>>>>>> Jukka
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > >>>>>>>>>>>
> > >>>>>>>>>>>> Hi guys,
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> I am having problems building custom boards outside of the Nuttx folder
> > >>>>>>>>>>>> tree. Usually I use the following folder structure.
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> |-> apps
> > >>>>>>>>>>>> |-> my-folder
> > >>>>>>>>>>>>        |-> my-apps
> > >>>>>>>>>>>>           |-> custom-app
> > >>>>>>>>>>>>        |-> my-boards
> > >>>>>>>>>>>>           |-> custom-board
> > >>>>>>>>>>>> |-> nuttx
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> To build my apps I just need to create a symbolic link called external
> > >>>>>>>>>>>> inside apps folder. To create a new custom board I start copying a similar
> > >>>>>>>>>>>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> *remove from defconfig:*
> > >>>>>>>>>>>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > >>>>>>>>>>>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> *add on defconfig:*
> > >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
> > >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> *Rename src/Make.defs to src/Makefile and append the line *
> > >>>>>>>>>>>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > >>>>>>>>>>>> make I got the errors
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>>>>>>>>>>> Create version.h
> > >>>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > >>>>>>>>>>>> make[2]: Entering directory
> > >>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > >>>>>>>>>>>> Makefile:23: board/Make.defs: No such file or directory
> > >>>>>>>>>>>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > >>>>>>>>>>>> make[2]: Leaving directory
> > >>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > >>>>>>>>>>>> make[1]: *** [Makefile:79: context] Error 2
> > >>>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > >>>>>>>>>>>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> Does anyone know how to fix this problem?
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> Thanks
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> Daniel Pereira de Carvalho
> > >>>>>>>>>>>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Jukka,

I'm still in the middle of building a docker image for your project.
Currently with slow internet it takes a while.

But what I see from the error that you report is that probably you
applied https://github.com/apache/incubator-nuttx/pull/5712 while
having https://github.com/apache/incubator-nuttx/pull/5274 still
reverted.

I will give feedback as soon as I will replicate your issue at my end.

Best regards,
Petro

пт, 11 бер. 2022 р. о 08:12 Jukka Laitinen <ju...@iki.fi> пише:
>
> Hi,
>
> With this patch, all my targets fail with:
>
> Makefile:23: board/Make.defs: No such file or directory
> make[3]: *** No rule to make target 'board/Make.defs'.  Stop.
>
> Should I add some new CONFIGs? Sorry but I don't have much time today to
> debug this further
>
> -Jukka
>
>
> On 10.3.2022 21.00, Petro Karashchenko wrote:
> > Hello Jukka,
> >
> > I would like to ask you to try an alternative PR
> > https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
> > works for you.
> >
> > Best regards,
> > Petro
> >
> > чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen <ju...@iki.fi> пише:
> >> Hi,
> >>
> >> This fixes the build for me, I just leave the
> >> CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
> >>
> >> Thanks,
> >>
> >> Jukka
> >>
> >> On 9.3.2022 19.22, Petro Karashchenko wrote:
> >>> Hello Jukka,
> >>>
> >>> I was able to localize the root cause of the issue. I've created
> >>> https://github.com/apache/incubator-nuttx/pull/5705 to recover things
> >>> and added a separate option that should be explicitly enabled to
> >>> re-use a board-level common code by custom boards users.
> >>>
> >>> Please try this change and feedback if that solves the problem.
> >>>
> >>> Best regards,
> >>> Petro
> >>>
> >>> чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <ju...@iki.fi> пише:
> >>>> Hi, sorry but I am away from computer atm.
> >>>>
> >>>> In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI
> >>>>
> >>>> - Jukka
> >>>>
> >>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> >>>>> Hello Jukka,
> >>>>>
> >>>>> Do you have any steps on how to build or download a docker image that
> >>>>> can be used to build that project?
> >>>>> It takes me too much time to get build running.
> >>>>>
> >>>>> Best regards,
> >>>>> Petro
> >>>>>
> >>>>> чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi> пише:
> >>>>>> And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
> >>>>>>
> >>>>>>
> >>>>>> Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> >>>>>>> Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
> >>>>>>>
> >>>>>>> - Jukka
> >>>>>>>
> >>>>>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> >>>>>>>> Hi Jukka,
> >>>>>>>>
> >>>>>>>> I tried to replicate your case, but failed with:
> >>>>>>>> $ git submodule update --init --recursive
> >>>>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> >>>>>>>> ERROR: Repository not found.
> >>>>>>>> fatal: Could not read from remote repository.
> >>>>>>>>
> >>>>>>>> Please make sure you have the correct access rights
> >>>>>>>> and the repository exists.
> >>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> >>>>>>>> path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> >>>>>>>> failed
> >>>>>>>> Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> >>>>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> >>>>>>>> ERROR: Repository not found.
> >>>>>>>> fatal: Could not read from remote repository.
> >>>>>>>>
> >>>>>>>> Please make sure you have the correct access rights
> >>>>>>>> and the repository exists.
> >>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> >>>>>>>> path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> >>>>>>>> failed
> >>>>>>>> Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> >>>>>>>>
> >>>>>>>> Best regards,
> >>>>>>>> Petro
> >>>>>>>>
> >>>>>>>> чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
> >>>>>>>>> Hi,
> >>>>>>>>>
> >>>>>>>>> Maybe I was jumping in to conclusion and the issue is not the same as
> >>>>>>>>> what I had. I was building PX4, which uses CMake build system, so I am
> >>>>>>>>> not having any Makefile or Make.defs in my own board directory. Also the
> >>>>>>>>> platform is not stm or arm, but risc-v.
> >>>>>>>>>
> >>>>>>>>> Anyhow, this is the error which I started getting in my build scripts:
> >>>>>>>>>
> >>>>>>>>> "
> >>>>>>>>>
> >>>>>>>>> ninja: error:
> >>>>>>>>> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> >>>>>>>>> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> >>>>>>>>> make: *** [Makefile:225: ssrc_icicle_default] Error 1
> >>>>>>>>> "
> >>>>>>>>>
> >>>>>>>>> My configs are:
> >>>>>>>>>
> >>>>>>>>> CONFIG_ARCH="risc-v"
> >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
> >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> >>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> >>>>>>>>>
> >>>>>>>>> One version, where it fails is available publicly in
> >>>>>>>>>
> >>>>>>>>> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> >>>>>>>>>
> >>>>>>>>> Building "make ssrc_icicle_default". The board files are in
> >>>>>>>>> boards/ssrc/icicle/nuttx-config and NuttX cloned in
> >>>>>>>>> platforms/nuttx/Nuttx/nuttx.
> >>>>>>>>>
> >>>>>>>>> I didn't yet start looking into it in detail, what goes wrong, just
> >>>>>>>>> bisected the nuttx and reverted the commit which broke it for me. I need
> >>>>>>>>> to look back later to see how to change the off-tree board config to get
> >>>>>>>>> it back online.
> >>>>>>>>>
> >>>>>>>>> Just noticed that the error is somewhat similar, although coming from
> >>>>>>>>> different build env. But in my case it is likely that I need to adapt
> >>>>>>>>> the cmake build scripts according to the changes in nuttx.
> >>>>>>>>>
> >>>>>>>>> -Jukka
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On 3.3.2022 9.37, Petro Karashchenko wrote:
> >>>>>>>>>> Hello Jukka,
> >>>>>>>>>>
> >>>>>>>>>> So you experience the same problem as Daniel and reverting the commit helps?
> >>>>>>>>>>
> >>>>>>>>>> Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> >>>>>>>>>> reuse common code from "nuttx/board/...". I'm using a custom board
> >>>>>>>>>> based on SAME70 and after
> >>>>>>>>>> https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> >>>>>>>>>> tree broken. Now the folder structure for "boards/arm/samv7" is the
> >>>>>>>>>> same as in "boards/arm/stm32". Here is what I did to get it back
> >>>>>>>>>> running:
> >>>>>>>>>> 1. Synced "custom-board/scripts/Make.defs" with
> >>>>>>>>>> "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> >>>>>>>>>> 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> >>>>>>>>>> and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> >>>>>>>>>> 3. Removed files in my code tree that have exactly the same
> >>>>>>>>>> implementation as files from "boards/arm/samv7/common"
> >>>>>>>>>>
> >>>>>>>>>> It seems like Daniel is hitting the same issue, so I expect that
> >>>>>>>>>> renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> >>>>>>>>>> should fix the issue without any additional file clean-up.
> >>>>>>>>>> Please give me feedback if that helps.
> >>>>>>>>>>
> >>>>>>>>>> Best regards,
> >>>>>>>>>> Petro
> >>>>>>>>>>
> >>>>>>>>>> чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> >>>>>>>>>>> HI,
> >>>>>>>>>>>
> >>>>>>>>>>> Not sure what is the correct way to fix this, but I reverted:
> >>>>>>>>>>>
> >>>>>>>>>>> "
> >>>>>>>>>>>
> >>>>>>>>>>> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> >>>>>>>>>>> Author: Petro Karashchenko <pe...@gmail.com>
> >>>>>>>>>>> Date:   Wed Jan 19 11:16:11 2022 +0200
> >>>>>>>>>>>
> >>>>>>>>>>>         tools: add option to reuse boards common files for custom boards
> >>>>>>>>>>>
> >>>>>>>>>>>         Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> >>>>>>>>>>> "
> >>>>>>>>>>>
> >>>>>>>>>>> Petro, what is the proper way to configure this?
> >>>>>>>>>>>
> >>>>>>>>>>> Thanks,
> >>>>>>>>>>>
> >>>>>>>>>>> Jukka
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> >>>>>>>>>>>
> >>>>>>>>>>>> Hi guys,
> >>>>>>>>>>>>
> >>>>>>>>>>>> I am having problems building custom boards outside of the Nuttx folder
> >>>>>>>>>>>> tree. Usually I use the following folder structure.
> >>>>>>>>>>>>
> >>>>>>>>>>>> |-> apps
> >>>>>>>>>>>> |-> my-folder
> >>>>>>>>>>>>        |-> my-apps
> >>>>>>>>>>>>           |-> custom-app
> >>>>>>>>>>>>        |-> my-boards
> >>>>>>>>>>>>           |-> custom-board
> >>>>>>>>>>>> |-> nuttx
> >>>>>>>>>>>>
> >>>>>>>>>>>> To build my apps I just need to create a symbolic link called external
> >>>>>>>>>>>> inside apps folder. To create a new custom board I start copying a similar
> >>>>>>>>>>>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> >>>>>>>>>>>>
> >>>>>>>>>>>> *remove from defconfig:*
> >>>>>>>>>>>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> >>>>>>>>>>>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> >>>>>>>>>>>>
> >>>>>>>>>>>> *add on defconfig:*
> >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
> >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> >>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> >>>>>>>>>>>>
> >>>>>>>>>>>> *Rename src/Make.defs to src/Makefile and append the line *
> >>>>>>>>>>>> include $(TOPDIR)/boards/Board.mk at the end of file.
> >>>>>>>>>>>>
> >>>>>>>>>>>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> >>>>>>>>>>>> make I got the errors
> >>>>>>>>>>>>
> >>>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>>>> Create version.h
> >>>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> >>>>>>>>>>>> make[2]: Entering directory
> >>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>>>>>>>>>>> Makefile:23: board/Make.defs: No such file or directory
> >>>>>>>>>>>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> >>>>>>>>>>>> make[2]: Leaving directory
> >>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>>>>>>>>>>> make[1]: *** [Makefile:79: context] Error 2
> >>>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> >>>>>>>>>>>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> >>>>>>>>>>>>
> >>>>>>>>>>>> Does anyone know how to fix this problem?
> >>>>>>>>>>>>
> >>>>>>>>>>>> Thanks
> >>>>>>>>>>>>
> >>>>>>>>>>>> Daniel Pereira de Carvalho
> >>>>>>>>>>>>

Re: Error when building custom board

Posted by Jukka Laitinen <ju...@iki.fi>.
Hi,

With this patch, all my targets fail with:

Makefile:23: board/Make.defs: No such file or directory
make[3]: *** No rule to make target 'board/Make.defs'.  Stop.

Should I add some new CONFIGs? Sorry but I don't have much time today to 
debug this further

-Jukka


On 10.3.2022 21.00, Petro Karashchenko wrote:
> Hello Jukka,
>
> I would like to ask you to try an alternative PR
> https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
> works for you.
>
> Best regards,
> Petro
>
> чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen <ju...@iki.fi> пише:
>> Hi,
>>
>> This fixes the build for me, I just leave the
>> CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
>>
>> Thanks,
>>
>> Jukka
>>
>> On 9.3.2022 19.22, Petro Karashchenko wrote:
>>> Hello Jukka,
>>>
>>> I was able to localize the root cause of the issue. I've created
>>> https://github.com/apache/incubator-nuttx/pull/5705 to recover things
>>> and added a separate option that should be explicitly enabled to
>>> re-use a board-level common code by custom boards users.
>>>
>>> Please try this change and feedback if that solves the problem.
>>>
>>> Best regards,
>>> Petro
>>>
>>> чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <ju...@iki.fi> пише:
>>>> Hi, sorry but I am away from computer atm.
>>>>
>>>> In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI
>>>>
>>>> - Jukka
>>>>
>>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
>>>>> Hello Jukka,
>>>>>
>>>>> Do you have any steps on how to build or download a docker image that
>>>>> can be used to build that project?
>>>>> It takes me too much time to get build running.
>>>>>
>>>>> Best regards,
>>>>> Petro
>>>>>
>>>>> чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi> пише:
>>>>>> And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
>>>>>>
>>>>>>
>>>>>> Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
>>>>>>> Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
>>>>>>>
>>>>>>> - Jukka
>>>>>>>
>>>>>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
>>>>>>>> Hi Jukka,
>>>>>>>>
>>>>>>>> I tried to replicate your case, but failed with:
>>>>>>>> $ git submodule update --init --recursive
>>>>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
>>>>>>>> ERROR: Repository not found.
>>>>>>>> fatal: Could not read from remote repository.
>>>>>>>>
>>>>>>>> Please make sure you have the correct access rights
>>>>>>>> and the repository exists.
>>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
>>>>>>>> path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
>>>>>>>> failed
>>>>>>>> Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
>>>>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
>>>>>>>> ERROR: Repository not found.
>>>>>>>> fatal: Could not read from remote repository.
>>>>>>>>
>>>>>>>> Please make sure you have the correct access rights
>>>>>>>> and the repository exists.
>>>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
>>>>>>>> path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
>>>>>>>> failed
>>>>>>>> Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Petro
>>>>>>>>
>>>>>>>> чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Maybe I was jumping in to conclusion and the issue is not the same as
>>>>>>>>> what I had. I was building PX4, which uses CMake build system, so I am
>>>>>>>>> not having any Makefile or Make.defs in my own board directory. Also the
>>>>>>>>> platform is not stm or arm, but risc-v.
>>>>>>>>>
>>>>>>>>> Anyhow, this is the error which I started getting in my build scripts:
>>>>>>>>>
>>>>>>>>> "
>>>>>>>>>
>>>>>>>>> ninja: error:
>>>>>>>>> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
>>>>>>>>> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
>>>>>>>>> make: *** [Makefile:225: ssrc_icicle_default] Error 1
>>>>>>>>> "
>>>>>>>>>
>>>>>>>>> My configs are:
>>>>>>>>>
>>>>>>>>> CONFIG_ARCH="risc-v"
>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
>>>>>>>>>
>>>>>>>>> One version, where it fails is available publicly in
>>>>>>>>>
>>>>>>>>> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
>>>>>>>>>
>>>>>>>>> Building "make ssrc_icicle_default". The board files are in
>>>>>>>>> boards/ssrc/icicle/nuttx-config and NuttX cloned in
>>>>>>>>> platforms/nuttx/Nuttx/nuttx.
>>>>>>>>>
>>>>>>>>> I didn't yet start looking into it in detail, what goes wrong, just
>>>>>>>>> bisected the nuttx and reverted the commit which broke it for me. I need
>>>>>>>>> to look back later to see how to change the off-tree board config to get
>>>>>>>>> it back online.
>>>>>>>>>
>>>>>>>>> Just noticed that the error is somewhat similar, although coming from
>>>>>>>>> different build env. But in my case it is likely that I need to adapt
>>>>>>>>> the cmake build scripts according to the changes in nuttx.
>>>>>>>>>
>>>>>>>>> -Jukka
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 3.3.2022 9.37, Petro Karashchenko wrote:
>>>>>>>>>> Hello Jukka,
>>>>>>>>>>
>>>>>>>>>> So you experience the same problem as Daniel and reverting the commit helps?
>>>>>>>>>>
>>>>>>>>>> Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
>>>>>>>>>> reuse common code from "nuttx/board/...". I'm using a custom board
>>>>>>>>>> based on SAME70 and after
>>>>>>>>>> https://github.com/apache/incubator-nuttx/pull/4981 I found my code
>>>>>>>>>> tree broken. Now the folder structure for "boards/arm/samv7" is the
>>>>>>>>>> same as in "boards/arm/stm32". Here is what I did to get it back
>>>>>>>>>> running:
>>>>>>>>>> 1. Synced "custom-board/scripts/Make.defs" with
>>>>>>>>>> "boards/arm/samv7/same70-xplained/scripts/Make.defs"
>>>>>>>>>> 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
>>>>>>>>>> and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
>>>>>>>>>> 3. Removed files in my code tree that have exactly the same
>>>>>>>>>> implementation as files from "boards/arm/samv7/common"
>>>>>>>>>>
>>>>>>>>>> It seems like Daniel is hitting the same issue, so I expect that
>>>>>>>>>> renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
>>>>>>>>>> should fix the issue without any additional file clean-up.
>>>>>>>>>> Please give me feedback if that helps.
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>> Petro
>>>>>>>>>>
>>>>>>>>>> чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
>>>>>>>>>>> HI,
>>>>>>>>>>>
>>>>>>>>>>> Not sure what is the correct way to fix this, but I reverted:
>>>>>>>>>>>
>>>>>>>>>>> "
>>>>>>>>>>>
>>>>>>>>>>> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
>>>>>>>>>>> Author: Petro Karashchenko <pe...@gmail.com>
>>>>>>>>>>> Date:   Wed Jan 19 11:16:11 2022 +0200
>>>>>>>>>>>
>>>>>>>>>>>         tools: add option to reuse boards common files for custom boards
>>>>>>>>>>>
>>>>>>>>>>>         Signed-off-by: Petro Karashchenko <pe...@gmail.com>
>>>>>>>>>>> "
>>>>>>>>>>>
>>>>>>>>>>> Petro, what is the proper way to configure this?
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>> Jukka
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi guys,
>>>>>>>>>>>>
>>>>>>>>>>>> I am having problems building custom boards outside of the Nuttx folder
>>>>>>>>>>>> tree. Usually I use the following folder structure.
>>>>>>>>>>>>
>>>>>>>>>>>> |-> apps
>>>>>>>>>>>> |-> my-folder
>>>>>>>>>>>>        |-> my-apps
>>>>>>>>>>>>           |-> custom-app
>>>>>>>>>>>>        |-> my-boards
>>>>>>>>>>>>           |-> custom-board
>>>>>>>>>>>> |-> nuttx
>>>>>>>>>>>>
>>>>>>>>>>>> To build my apps I just need to create a symbolic link called external
>>>>>>>>>>>> inside apps folder. To create a new custom board I start copying a similar
>>>>>>>>>>>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
>>>>>>>>>>>>
>>>>>>>>>>>> *remove from defconfig:*
>>>>>>>>>>>> CONFIG_ARCH_BOARD="nucleo-g431kb"
>>>>>>>>>>>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
>>>>>>>>>>>>
>>>>>>>>>>>> *add on defconfig:*
>>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
>>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
>>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
>>>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
>>>>>>>>>>>>
>>>>>>>>>>>> *Rename src/Make.defs to src/Makefile and append the line *
>>>>>>>>>>>> include $(TOPDIR)/boards/Board.mk at the end of file.
>>>>>>>>>>>>
>>>>>>>>>>>> This works well for me up to Nuttx version 10.2.0 but now when I try to
>>>>>>>>>>>> make I got the errors
>>>>>>>>>>>>
>>>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>>>> Create version.h
>>>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
>>>>>>>>>>>> make[2]: Entering directory
>>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
>>>>>>>>>>>> Makefile:23: board/Make.defs: No such file or directory
>>>>>>>>>>>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
>>>>>>>>>>>> make[2]: Leaving directory
>>>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
>>>>>>>>>>>> make[1]: *** [Makefile:79: context] Error 2
>>>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
>>>>>>>>>>>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
>>>>>>>>>>>>
>>>>>>>>>>>> Does anyone know how to fix this problem?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks
>>>>>>>>>>>>
>>>>>>>>>>>> Daniel Pereira de Carvalho
>>>>>>>>>>>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Jukka,

I would like to ask you to try an alternative PR
https://github.com/apache/incubator-nuttx/pull/5712 and feedback if it
works for you.

Best regards,
Petro

чт, 10 бер. 2022 р. о 07:24 Jukka Laitinen <ju...@iki.fi> пише:
>
> Hi,
>
> This fixes the build for me, I just leave the
> CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.
>
> Thanks,
>
> Jukka
>
> On 9.3.2022 19.22, Petro Karashchenko wrote:
> > Hello Jukka,
> >
> > I was able to localize the root cause of the issue. I've created
> > https://github.com/apache/incubator-nuttx/pull/5705 to recover things
> > and added a separate option that should be explicitly enabled to
> > re-use a board-level common code by custom boards users.
> >
> > Please try this change and feedback if that solves the problem.
> >
> > Best regards,
> > Petro
> >
> > чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <ju...@iki.fi> пише:
> >> Hi, sorry but I am away from computer atm.
> >>
> >> In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI
> >>
> >> - Jukka
> >>
> >> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> >>> Hello Jukka,
> >>>
> >>> Do you have any steps on how to build or download a docker image that
> >>> can be used to build that project?
> >>> It takes me too much time to get build running.
> >>>
> >>> Best regards,
> >>> Petro
> >>>
> >>> чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi> пише:
> >>>> And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
> >>>>
> >>>>
> >>>> Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> >>>>> Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
> >>>>>
> >>>>> - Jukka
> >>>>>
> >>>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> >>>>>> Hi Jukka,
> >>>>>>
> >>>>>> I tried to replicate your case, but failed with:
> >>>>>> $ git submodule update --init --recursive
> >>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> >>>>>> ERROR: Repository not found.
> >>>>>> fatal: Could not read from remote repository.
> >>>>>>
> >>>>>> Please make sure you have the correct access rights
> >>>>>> and the repository exists.
> >>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> >>>>>> path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> >>>>>> failed
> >>>>>> Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> >>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> >>>>>> ERROR: Repository not found.
> >>>>>> fatal: Could not read from remote repository.
> >>>>>>
> >>>>>> Please make sure you have the correct access rights
> >>>>>> and the repository exists.
> >>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> >>>>>> path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> >>>>>> failed
> >>>>>> Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> >>>>>>
> >>>>>> Best regards,
> >>>>>> Petro
> >>>>>>
> >>>>>> чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
> >>>>>>> Hi,
> >>>>>>>
> >>>>>>> Maybe I was jumping in to conclusion and the issue is not the same as
> >>>>>>> what I had. I was building PX4, which uses CMake build system, so I am
> >>>>>>> not having any Makefile or Make.defs in my own board directory. Also the
> >>>>>>> platform is not stm or arm, but risc-v.
> >>>>>>>
> >>>>>>> Anyhow, this is the error which I started getting in my build scripts:
> >>>>>>>
> >>>>>>> "
> >>>>>>>
> >>>>>>> ninja: error:
> >>>>>>> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> >>>>>>> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> >>>>>>> make: *** [Makefile:225: ssrc_icicle_default] Error 1
> >>>>>>> "
> >>>>>>>
> >>>>>>> My configs are:
> >>>>>>>
> >>>>>>> CONFIG_ARCH="risc-v"
> >>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
> >>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> >>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> >>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> >>>>>>>
> >>>>>>> One version, where it fails is available publicly in
> >>>>>>>
> >>>>>>> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> >>>>>>>
> >>>>>>> Building "make ssrc_icicle_default". The board files are in
> >>>>>>> boards/ssrc/icicle/nuttx-config and NuttX cloned in
> >>>>>>> platforms/nuttx/Nuttx/nuttx.
> >>>>>>>
> >>>>>>> I didn't yet start looking into it in detail, what goes wrong, just
> >>>>>>> bisected the nuttx and reverted the commit which broke it for me. I need
> >>>>>>> to look back later to see how to change the off-tree board config to get
> >>>>>>> it back online.
> >>>>>>>
> >>>>>>> Just noticed that the error is somewhat similar, although coming from
> >>>>>>> different build env. But in my case it is likely that I need to adapt
> >>>>>>> the cmake build scripts according to the changes in nuttx.
> >>>>>>>
> >>>>>>> -Jukka
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> On 3.3.2022 9.37, Petro Karashchenko wrote:
> >>>>>>>> Hello Jukka,
> >>>>>>>>
> >>>>>>>> So you experience the same problem as Daniel and reverting the commit helps?
> >>>>>>>>
> >>>>>>>> Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> >>>>>>>> reuse common code from "nuttx/board/...". I'm using a custom board
> >>>>>>>> based on SAME70 and after
> >>>>>>>> https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> >>>>>>>> tree broken. Now the folder structure for "boards/arm/samv7" is the
> >>>>>>>> same as in "boards/arm/stm32". Here is what I did to get it back
> >>>>>>>> running:
> >>>>>>>> 1. Synced "custom-board/scripts/Make.defs" with
> >>>>>>>> "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> >>>>>>>> 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> >>>>>>>> and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> >>>>>>>> 3. Removed files in my code tree that have exactly the same
> >>>>>>>> implementation as files from "boards/arm/samv7/common"
> >>>>>>>>
> >>>>>>>> It seems like Daniel is hitting the same issue, so I expect that
> >>>>>>>> renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> >>>>>>>> should fix the issue without any additional file clean-up.
> >>>>>>>> Please give me feedback if that helps.
> >>>>>>>>
> >>>>>>>> Best regards,
> >>>>>>>> Petro
> >>>>>>>>
> >>>>>>>> чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> >>>>>>>>> HI,
> >>>>>>>>>
> >>>>>>>>> Not sure what is the correct way to fix this, but I reverted:
> >>>>>>>>>
> >>>>>>>>> "
> >>>>>>>>>
> >>>>>>>>> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> >>>>>>>>> Author: Petro Karashchenko <pe...@gmail.com>
> >>>>>>>>> Date:   Wed Jan 19 11:16:11 2022 +0200
> >>>>>>>>>
> >>>>>>>>>        tools: add option to reuse boards common files for custom boards
> >>>>>>>>>
> >>>>>>>>>        Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> >>>>>>>>> "
> >>>>>>>>>
> >>>>>>>>> Petro, what is the proper way to configure this?
> >>>>>>>>>
> >>>>>>>>> Thanks,
> >>>>>>>>>
> >>>>>>>>> Jukka
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> >>>>>>>>>
> >>>>>>>>>> Hi guys,
> >>>>>>>>>>
> >>>>>>>>>> I am having problems building custom boards outside of the Nuttx folder
> >>>>>>>>>> tree. Usually I use the following folder structure.
> >>>>>>>>>>
> >>>>>>>>>> |-> apps
> >>>>>>>>>> |-> my-folder
> >>>>>>>>>>       |-> my-apps
> >>>>>>>>>>          |-> custom-app
> >>>>>>>>>>       |-> my-boards
> >>>>>>>>>>          |-> custom-board
> >>>>>>>>>> |-> nuttx
> >>>>>>>>>>
> >>>>>>>>>> To build my apps I just need to create a symbolic link called external
> >>>>>>>>>> inside apps folder. To create a new custom board I start copying a similar
> >>>>>>>>>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> >>>>>>>>>>
> >>>>>>>>>> *remove from defconfig:*
> >>>>>>>>>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> >>>>>>>>>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> >>>>>>>>>>
> >>>>>>>>>> *add on defconfig:*
> >>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
> >>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> >>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> >>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> >>>>>>>>>>
> >>>>>>>>>> *Rename src/Make.defs to src/Makefile and append the line *
> >>>>>>>>>> include $(TOPDIR)/boards/Board.mk at the end of file.
> >>>>>>>>>>
> >>>>>>>>>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> >>>>>>>>>> make I got the errors
> >>>>>>>>>>
> >>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>>>>>>>>> Create version.h
> >>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> >>>>>>>>>> make[2]: Entering directory
> >>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>>>>>>>>> Makefile:23: board/Make.defs: No such file or directory
> >>>>>>>>>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> >>>>>>>>>> make[2]: Leaving directory
> >>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>>>>>>>>> make[1]: *** [Makefile:79: context] Error 2
> >>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> >>>>>>>>>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> >>>>>>>>>>
> >>>>>>>>>> Does anyone know how to fix this problem?
> >>>>>>>>>>
> >>>>>>>>>> Thanks
> >>>>>>>>>>
> >>>>>>>>>> Daniel Pereira de Carvalho
> >>>>>>>>>>

Re: Error when building custom board

Posted by Jukka Laitinen <ju...@iki.fi>.
Hi,

This fixes the build for me, I just leave the 
CONFIG_BOARD_CUSTOM_ARCH_BOARD_COMMON undefined.

Thanks,

Jukka

On 9.3.2022 19.22, Petro Karashchenko wrote:
> Hello Jukka,
>
> I was able to localize the root cause of the issue. I've created
> https://github.com/apache/incubator-nuttx/pull/5705 to recover things
> and added a separate option that should be explicitly enabled to
> re-use a board-level common code by custom boards users.
>
> Please try this change and feedback if that solves the problem.
>
> Best regards,
> Petro
>
> чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <ju...@iki.fi> пише:
>> Hi, sorry but I am away from computer atm.
>>
>> In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI
>>
>> - Jukka
>>
>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
>>> Hello Jukka,
>>>
>>> Do you have any steps on how to build or download a docker image that
>>> can be used to build that project?
>>> It takes me too much time to get build running.
>>>
>>> Best regards,
>>> Petro
>>>
>>> чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi> пише:
>>>> And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
>>>>
>>>>
>>>> Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
>>>>> Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
>>>>>
>>>>> - Jukka
>>>>>
>>>>> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
>>>>>> Hi Jukka,
>>>>>>
>>>>>> I tried to replicate your case, but failed with:
>>>>>> $ git submodule update --init --recursive
>>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
>>>>>> ERROR: Repository not found.
>>>>>> fatal: Could not read from remote repository.
>>>>>>
>>>>>> Please make sure you have the correct access rights
>>>>>> and the repository exists.
>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
>>>>>> path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
>>>>>> failed
>>>>>> Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
>>>>>> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
>>>>>> ERROR: Repository not found.
>>>>>> fatal: Could not read from remote repository.
>>>>>>
>>>>>> Please make sure you have the correct access rights
>>>>>> and the repository exists.
>>>>>> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
>>>>>> path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
>>>>>> failed
>>>>>> Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
>>>>>>
>>>>>> Best regards,
>>>>>> Petro
>>>>>>
>>>>>> чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Maybe I was jumping in to conclusion and the issue is not the same as
>>>>>>> what I had. I was building PX4, which uses CMake build system, so I am
>>>>>>> not having any Makefile or Make.defs in my own board directory. Also the
>>>>>>> platform is not stm or arm, but risc-v.
>>>>>>>
>>>>>>> Anyhow, this is the error which I started getting in my build scripts:
>>>>>>>
>>>>>>> "
>>>>>>>
>>>>>>> ninja: error:
>>>>>>> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
>>>>>>> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
>>>>>>> make: *** [Makefile:225: ssrc_icicle_default] Error 1
>>>>>>> "
>>>>>>>
>>>>>>> My configs are:
>>>>>>>
>>>>>>> CONFIG_ARCH="risc-v"
>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
>>>>>>>
>>>>>>> One version, where it fails is available publicly in
>>>>>>>
>>>>>>> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
>>>>>>>
>>>>>>> Building "make ssrc_icicle_default". The board files are in
>>>>>>> boards/ssrc/icicle/nuttx-config and NuttX cloned in
>>>>>>> platforms/nuttx/Nuttx/nuttx.
>>>>>>>
>>>>>>> I didn't yet start looking into it in detail, what goes wrong, just
>>>>>>> bisected the nuttx and reverted the commit which broke it for me. I need
>>>>>>> to look back later to see how to change the off-tree board config to get
>>>>>>> it back online.
>>>>>>>
>>>>>>> Just noticed that the error is somewhat similar, although coming from
>>>>>>> different build env. But in my case it is likely that I need to adapt
>>>>>>> the cmake build scripts according to the changes in nuttx.
>>>>>>>
>>>>>>> -Jukka
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 3.3.2022 9.37, Petro Karashchenko wrote:
>>>>>>>> Hello Jukka,
>>>>>>>>
>>>>>>>> So you experience the same problem as Daniel and reverting the commit helps?
>>>>>>>>
>>>>>>>> Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
>>>>>>>> reuse common code from "nuttx/board/...". I'm using a custom board
>>>>>>>> based on SAME70 and after
>>>>>>>> https://github.com/apache/incubator-nuttx/pull/4981 I found my code
>>>>>>>> tree broken. Now the folder structure for "boards/arm/samv7" is the
>>>>>>>> same as in "boards/arm/stm32". Here is what I did to get it back
>>>>>>>> running:
>>>>>>>> 1. Synced "custom-board/scripts/Make.defs" with
>>>>>>>> "boards/arm/samv7/same70-xplained/scripts/Make.defs"
>>>>>>>> 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
>>>>>>>> and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
>>>>>>>> 3. Removed files in my code tree that have exactly the same
>>>>>>>> implementation as files from "boards/arm/samv7/common"
>>>>>>>>
>>>>>>>> It seems like Daniel is hitting the same issue, so I expect that
>>>>>>>> renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
>>>>>>>> should fix the issue without any additional file clean-up.
>>>>>>>> Please give me feedback if that helps.
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Petro
>>>>>>>>
>>>>>>>> чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
>>>>>>>>> HI,
>>>>>>>>>
>>>>>>>>> Not sure what is the correct way to fix this, but I reverted:
>>>>>>>>>
>>>>>>>>> "
>>>>>>>>>
>>>>>>>>> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
>>>>>>>>> Author: Petro Karashchenko <pe...@gmail.com>
>>>>>>>>> Date:   Wed Jan 19 11:16:11 2022 +0200
>>>>>>>>>
>>>>>>>>>        tools: add option to reuse boards common files for custom boards
>>>>>>>>>
>>>>>>>>>        Signed-off-by: Petro Karashchenko <pe...@gmail.com>
>>>>>>>>> "
>>>>>>>>>
>>>>>>>>> Petro, what is the proper way to configure this?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> Jukka
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
>>>>>>>>>
>>>>>>>>>> Hi guys,
>>>>>>>>>>
>>>>>>>>>> I am having problems building custom boards outside of the Nuttx folder
>>>>>>>>>> tree. Usually I use the following folder structure.
>>>>>>>>>>
>>>>>>>>>> |-> apps
>>>>>>>>>> |-> my-folder
>>>>>>>>>>       |-> my-apps
>>>>>>>>>>          |-> custom-app
>>>>>>>>>>       |-> my-boards
>>>>>>>>>>          |-> custom-board
>>>>>>>>>> |-> nuttx
>>>>>>>>>>
>>>>>>>>>> To build my apps I just need to create a symbolic link called external
>>>>>>>>>> inside apps folder. To create a new custom board I start copying a similar
>>>>>>>>>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
>>>>>>>>>>
>>>>>>>>>> *remove from defconfig:*
>>>>>>>>>> CONFIG_ARCH_BOARD="nucleo-g431kb"
>>>>>>>>>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
>>>>>>>>>>
>>>>>>>>>> *add on defconfig:*
>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM=y
>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
>>>>>>>>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
>>>>>>>>>>
>>>>>>>>>> *Rename src/Make.defs to src/Makefile and append the line *
>>>>>>>>>> include $(TOPDIR)/boards/Board.mk at the end of file.
>>>>>>>>>>
>>>>>>>>>> This works well for me up to Nuttx version 10.2.0 but now when I try to
>>>>>>>>>> make I got the errors
>>>>>>>>>>
>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>>>>>>>>> Create version.h
>>>>>>>>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
>>>>>>>>>> make[2]: Entering directory
>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
>>>>>>>>>> Makefile:23: board/Make.defs: No such file or directory
>>>>>>>>>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
>>>>>>>>>> make[2]: Leaving directory
>>>>>>>>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
>>>>>>>>>> make[1]: *** [Makefile:79: context] Error 2
>>>>>>>>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
>>>>>>>>>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
>>>>>>>>>>
>>>>>>>>>> Does anyone know how to fix this problem?
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>>
>>>>>>>>>> Daniel Pereira de Carvalho
>>>>>>>>>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Jukka,

I was able to localize the root cause of the issue. I've created
https://github.com/apache/incubator-nuttx/pull/5705 to recover things
and added a separate option that should be explicitly enabled to
re-use a board-level common code by custom boards users.

Please try this change and feedback if that solves the problem.

Best regards,
Petro

чт, 3 бер. 2022 р. о 15:33 Jukka Laitinen <ju...@iki.fi> пише:
>
> Hi, sorry but I am away from computer atm.
>
> In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI
>
> - Jukka
>
> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> > Hello Jukka,
> >
> > Do you have any steps on how to build or download a docker image that
> > can be used to build that project?
> > It takes me too much time to get build running.
> >
> > Best regards,
> > Petro
> >
> > чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi> пише:
> > >
> > > And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
> > >
> > >
> > > Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> > > > Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
> > > >
> > > > - Jukka
> > > >
> > > > Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> > > > > Hi Jukka,
> > > > >
> > > > > I tried to replicate your case, but failed with:
> > > > > $ git submodule update --init --recursive
> > > > > Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > > > > ERROR: Repository not found.
> > > > > fatal: Could not read from remote repository.
> > > > >
> > > > > Please make sure you have the correct access rights
> > > > > and the repository exists.
> > > > > fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > > > > path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > > > > failed
> > > > > Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> > > > > Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > > > > ERROR: Repository not found.
> > > > > fatal: Could not read from remote repository.
> > > > >
> > > > > Please make sure you have the correct access rights
> > > > > and the repository exists.
> > > > > fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > > > > path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > > > > failed
> > > > > Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> > > > >
> > > > > Best regards,
> > > > > Petro
> > > > >
> > > > > чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > > > platform is not stm or arm, but risc-v.
> > > > > >
> > > > > > Anyhow, this is the error which I started getting in my build scripts:
> > > > > >
> > > > > > "
> > > > > >
> > > > > > ninja: error:
> > > > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > > "
> > > > > >
> > > > > > My configs are:
> > > > > >
> > > > > > CONFIG_ARCH="risc-v"
> > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > > >
> > > > > > One version, where it fails is available publicly in
> > > > > >
> > > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > > > >
> > > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > > platforms/nuttx/Nuttx/nuttx.
> > > > > >
> > > > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > > > to look back later to see how to change the off-tree board config to get
> > > > > > it back online.
> > > > > >
> > > > > > Just noticed that the error is somewhat similar, although coming from
> > > > > > different build env. But in my case it is likely that I need to adapt
> > > > > > the cmake build scripts according to the changes in nuttx.
> > > > > >
> > > > > > -Jukka
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > > Hello Jukka,
> > > > > > >
> > > > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > > > >
> > > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > > > based on SAME70 and after
> > > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > > > running:
> > > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > > >
> > > > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > > > should fix the issue without any additional file clean-up.
> > > > > > > Please give me feedback if that helps.
> > > > > > >
> > > > > > > Best regards,
> > > > > > > Petro
> > > > > > >
> > > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > > >> HI,
> > > > > > >>
> > > > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > > > >>
> > > > > > >> "
> > > > > > >>
> > > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > > >>
> > > > > > >>       tools: add option to reuse boards common files for custom boards
> > > > > > >>
> > > > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > > > >> "
> > > > > > >>
> > > > > > >> Petro, what is the proper way to configure this?
> > > > > > >>
> > > > > > >> Thanks,
> > > > > > >>
> > > > > > >> Jukka
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > > >>
> > > > > > >>> Hi guys,
> > > > > > >>>
> > > > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > > > >>> tree. Usually I use the following folder structure.
> > > > > > >>>
> > > > > > >>> |-> apps
> > > > > > >>> |-> my-folder
> > > > > > >>>      |-> my-apps
> > > > > > >>>         |-> custom-app
> > > > > > >>>      |-> my-boards
> > > > > > >>>         |-> custom-board
> > > > > > >>> |-> nuttx
> > > > > > >>>
> > > > > > >>> To build my apps I just need to create a symbolic link called external
> > > > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > >>>
> > > > > > >>> *remove from defconfig:*
> > > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > >>>
> > > > > > >>> *add on defconfig:*
> > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > >>>
> > > > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > >>>
> > > > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > >>> make I got the errors
> > > > > > >>>
> > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > >>> Create version.h
> > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > >>> make[2]: Entering directory
> > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > > > >>> make[2]: Leaving directory
> > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > > >>>
> > > > > > >>> Does anyone know how to fix this problem?
> > > > > > >>>
> > > > > > >>> Thanks
> > > > > > >>>
> > > > > > >>> Daniel Pereira de Carvalho
> > > > > > >>>
> > > >
> >

Re: Error when building custom board

Posted by Jukka Laitinen <ju...@iki.fi>.
Hi, sorry but I am away from computer atm.

In the project there is "packaging" subdirectory, it contains some docker env, which is also used in TII's CI

- Jukka

Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> Hello Jukka,
> 
> Do you have any steps on how to build or download a docker image that
> can be used to build that project?
> It takes me too much time to get build running.
> 
> Best regards,
> Petro
> 
> чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi> пише:
> >
> > And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
> >
> >
> > Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> > > Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
> > >
> > > - Jukka
> > >
> > > Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> > > > Hi Jukka,
> > > >
> > > > I tried to replicate your case, but failed with:
> > > > $ git submodule update --init --recursive
> > > > Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > > > ERROR: Repository not found.
> > > > fatal: Could not read from remote repository.
> > > >
> > > > Please make sure you have the correct access rights
> > > > and the repository exists.
> > > > fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > > > path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > > > failed
> > > > Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> > > > Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > > > ERROR: Repository not found.
> > > > fatal: Could not read from remote repository.
> > > >
> > > > Please make sure you have the correct access rights
> > > > and the repository exists.
> > > > fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > > > path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > > > failed
> > > > Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> > > >
> > > > Best regards,
> > > > Petro
> > > >
> > > > чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
> > > > >
> > > > > Hi,
> > > > >
> > > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > > platform is not stm or arm, but risc-v.
> > > > >
> > > > > Anyhow, this is the error which I started getting in my build scripts:
> > > > >
> > > > > "
> > > > >
> > > > > ninja: error:
> > > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > "
> > > > >
> > > > > My configs are:
> > > > >
> > > > > CONFIG_ARCH="risc-v"
> > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > >
> > > > > One version, where it fails is available publicly in
> > > > >
> > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > > >
> > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > platforms/nuttx/Nuttx/nuttx.
> > > > >
> > > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > > to look back later to see how to change the off-tree board config to get
> > > > > it back online.
> > > > >
> > > > > Just noticed that the error is somewhat similar, although coming from
> > > > > different build env. But in my case it is likely that I need to adapt
> > > > > the cmake build scripts according to the changes in nuttx.
> > > > >
> > > > > -Jukka
> > > > >
> > > > >
> > > > >
> > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > Hello Jukka,
> > > > > >
> > > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > > >
> > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > > based on SAME70 and after
> > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > > running:
> > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > >
> > > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > > should fix the issue without any additional file clean-up.
> > > > > > Please give me feedback if that helps.
> > > > > >
> > > > > > Best regards,
> > > > > > Petro
> > > > > >
> > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > >> HI,
> > > > > >>
> > > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > > >>
> > > > > >> "
> > > > > >>
> > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > >>
> > > > > >>       tools: add option to reuse boards common files for custom boards
> > > > > >>
> > > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > > >> "
> > > > > >>
> > > > > >> Petro, what is the proper way to configure this?
> > > > > >>
> > > > > >> Thanks,
> > > > > >>
> > > > > >> Jukka
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > >>
> > > > > >>> Hi guys,
> > > > > >>>
> > > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > > >>> tree. Usually I use the following folder structure.
> > > > > >>>
> > > > > >>> |-> apps
> > > > > >>> |-> my-folder
> > > > > >>>      |-> my-apps
> > > > > >>>         |-> custom-app
> > > > > >>>      |-> my-boards
> > > > > >>>         |-> custom-board
> > > > > >>> |-> nuttx
> > > > > >>>
> > > > > >>> To build my apps I just need to create a symbolic link called external
> > > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > >>>
> > > > > >>> *remove from defconfig:*
> > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > >>>
> > > > > >>> *add on defconfig:*
> > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > >>>
> > > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > >>>
> > > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > >>> make I got the errors
> > > > > >>>
> > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > >>> Create version.h
> > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > >>> make[2]: Entering directory
> > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > > >>> make[2]: Leaving directory
> > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > >>>
> > > > > >>> Does anyone know how to fix this problem?
> > > > > >>>
> > > > > >>> Thanks
> > > > > >>>
> > > > > >>> Daniel Pereira de Carvalho
> > > > > >>>
> > >
>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Jukka,

Do you have any steps on how to build or download a docker image that
can be used to build that project?
It takes me too much time to get build running.

Best regards,
Petro

чт, 3 бер. 2022 р. о 12:43 Jukka Laitinen <ju...@iki.fi> пише:
>
> And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)
>
>
> Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> > Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
> >
> > - Jukka
> >
> > Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> > > Hi Jukka,
> > >
> > > I tried to replicate your case, but failed with:
> > > $ git submodule update --init --recursive
> > > Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > > ERROR: Repository not found.
> > > fatal: Could not read from remote repository.
> > >
> > > Please make sure you have the correct access rights
> > > and the repository exists.
> > > fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > > path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > > failed
> > > Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> > > Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > > ERROR: Repository not found.
> > > fatal: Could not read from remote repository.
> > >
> > > Please make sure you have the correct access rights
> > > and the repository exists.
> > > fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > > path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > > failed
> > > Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> > >
> > > Best regards,
> > > Petro
> > >
> > > чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
> > > >
> > > > Hi,
> > > >
> > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > platform is not stm or arm, but risc-v.
> > > >
> > > > Anyhow, this is the error which I started getting in my build scripts:
> > > >
> > > > "
> > > >
> > > > ninja: error:
> > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > "
> > > >
> > > > My configs are:
> > > >
> > > > CONFIG_ARCH="risc-v"
> > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > >
> > > > One version, where it fails is available publicly in
> > > >
> > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > >
> > > > Building "make ssrc_icicle_default". The board files are in
> > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > platforms/nuttx/Nuttx/nuttx.
> > > >
> > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > to look back later to see how to change the off-tree board config to get
> > > > it back online.
> > > >
> > > > Just noticed that the error is somewhat similar, although coming from
> > > > different build env. But in my case it is likely that I need to adapt
> > > > the cmake build scripts according to the changes in nuttx.
> > > >
> > > > -Jukka
> > > >
> > > >
> > > >
> > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > Hello Jukka,
> > > > >
> > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > >
> > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > based on SAME70 and after
> > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > running:
> > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > 3. Removed files in my code tree that have exactly the same
> > > > > implementation as files from "boards/arm/samv7/common"
> > > > >
> > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > should fix the issue without any additional file clean-up.
> > > > > Please give me feedback if that helps.
> > > > >
> > > > > Best regards,
> > > > > Petro
> > > > >
> > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > >> HI,
> > > > >>
> > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > >>
> > > > >> "
> > > > >>
> > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > >>
> > > > >>       tools: add option to reuse boards common files for custom boards
> > > > >>
> > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > >> "
> > > > >>
> > > > >> Petro, what is the proper way to configure this?
> > > > >>
> > > > >> Thanks,
> > > > >>
> > > > >> Jukka
> > > > >>
> > > > >>
> > > > >>
> > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > >>
> > > > >>> Hi guys,
> > > > >>>
> > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > >>> tree. Usually I use the following folder structure.
> > > > >>>
> > > > >>> |-> apps
> > > > >>> |-> my-folder
> > > > >>>      |-> my-apps
> > > > >>>         |-> custom-app
> > > > >>>      |-> my-boards
> > > > >>>         |-> custom-board
> > > > >>> |-> nuttx
> > > > >>>
> > > > >>> To build my apps I just need to create a symbolic link called external
> > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > >>>
> > > > >>> *remove from defconfig:*
> > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > >>>
> > > > >>> *add on defconfig:*
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > >>>
> > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > >>>
> > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > >>> make I got the errors
> > > > >>>
> > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> Create version.h
> > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > >>> make[2]: Entering directory
> > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > >>> make[2]: Leaving directory
> > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > >>>
> > > > >>> Does anyone know how to fix this problem?
> > > > >>>
> > > > >>> Thanks
> > > > >>>
> > > > >>> Daniel Pereira de Carvalho
> > > > >>>
> >

Re: Error when building custom board

Posted by Jukka Laitinen <ju...@iki.fi>.
And also note that the commit I mentioned is already reverted in nuttx submodule, so you need to put it back in order to re-produce the issue :)


Jukka Laitinen kirjoitti torstai 3. maaliskuuta 2022:
> Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.
> 
> - Jukka
> 
> Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> > Hi Jukka,
> > 
> > I tried to replicate your case, but failed with:
> > $ git submodule update --init --recursive
> > Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > ERROR: Repository not found.
> > fatal: Could not read from remote repository.
> > 
> > Please make sure you have the correct access rights
> > and the repository exists.
> > fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > failed
> > Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> > Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> > ERROR: Repository not found.
> > fatal: Could not read from remote repository.
> > 
> > Please make sure you have the correct access rights
> > and the repository exists.
> > fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> > path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> > failed
> > Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> > 
> > Best regards,
> > Petro
> > 
> > чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
> > >
> > > Hi,
> > >
> > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > what I had. I was building PX4, which uses CMake build system, so I am
> > > not having any Makefile or Make.defs in my own board directory. Also the
> > > platform is not stm or arm, but risc-v.
> > >
> > > Anyhow, this is the error which I started getting in my build scripts:
> > >
> > > "
> > >
> > > ninja: error:
> > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > "
> > >
> > > My configs are:
> > >
> > > CONFIG_ARCH="risc-v"
> > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > >
> > > One version, where it fails is available publicly in
> > >
> > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > >
> > > Building "make ssrc_icicle_default". The board files are in
> > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > platforms/nuttx/Nuttx/nuttx.
> > >
> > > I didn't yet start looking into it in detail, what goes wrong, just
> > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > to look back later to see how to change the off-tree board config to get
> > > it back online.
> > >
> > > Just noticed that the error is somewhat similar, although coming from
> > > different build env. But in my case it is likely that I need to adapt
> > > the cmake build scripts according to the changes in nuttx.
> > >
> > > -Jukka
> > >
> > >
> > >
> > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > Hello Jukka,
> > > >
> > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > >
> > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > based on SAME70 and after
> > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > running:
> > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > 3. Removed files in my code tree that have exactly the same
> > > > implementation as files from "boards/arm/samv7/common"
> > > >
> > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > should fix the issue without any additional file clean-up.
> > > > Please give me feedback if that helps.
> > > >
> > > > Best regards,
> > > > Petro
> > > >
> > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > >> HI,
> > > >>
> > > >> Not sure what is the correct way to fix this, but I reverted:
> > > >>
> > > >> "
> > > >>
> > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > >>
> > > >>       tools: add option to reuse boards common files for custom boards
> > > >>
> > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > >> "
> > > >>
> > > >> Petro, what is the proper way to configure this?
> > > >>
> > > >> Thanks,
> > > >>
> > > >> Jukka
> > > >>
> > > >>
> > > >>
> > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > >>
> > > >>> Hi guys,
> > > >>>
> > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > >>> tree. Usually I use the following folder structure.
> > > >>>
> > > >>> |-> apps
> > > >>> |-> my-folder
> > > >>>      |-> my-apps
> > > >>>         |-> custom-app
> > > >>>      |-> my-boards
> > > >>>         |-> custom-board
> > > >>> |-> nuttx
> > > >>>
> > > >>> To build my apps I just need to create a symbolic link called external
> > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > >>>
> > > >>> *remove from defconfig:*
> > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > >>>
> > > >>> *add on defconfig:*
> > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > >>>
> > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > >>>
> > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > >>> make I got the errors
> > > >>>
> > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > >>> Create version.h
> > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > >>> make[2]: Entering directory
> > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > >>> make[2]: Leaving directory
> > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > >>>
> > > >>> Does anyone know how to fix this problem?
> > > >>>
> > > >>> Thanks
> > > >>>
> > > >>> Daniel Pereira de Carvalho
> > > >>>
> 

Re: Error when building custom board

Posted by Jukka Laitinen <ju...@iki.fi>.
Hi, sorry about that; you can just remove that submodule, it is not needed to re-produce the issue.

- Jukka

Petro Karashchenko kirjoitti torstai 3. maaliskuuta 2022:
> Hi Jukka,
> 
> I tried to replicate your case, but failed with:
> $ git submodule update --init --recursive
> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> ERROR: Repository not found.
> fatal: Could not read from remote repository.
> 
> Please make sure you have the correct access rights
> and the repository exists.
> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
> failed
> Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
> Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
> ERROR: Repository not found.
> fatal: Could not read from remote repository.
> 
> Please make sure you have the correct access rights
> and the repository exists.
> fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
> path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
> failed
> Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting
> 
> Best regards,
> Petro
> 
> чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
> >
> > Hi,
> >
> > Maybe I was jumping in to conclusion and the issue is not the same as
> > what I had. I was building PX4, which uses CMake build system, so I am
> > not having any Makefile or Make.defs in my own board directory. Also the
> > platform is not stm or arm, but risc-v.
> >
> > Anyhow, this is the error which I started getting in my build scripts:
> >
> > "
> >
> > ninja: error:
> > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > "
> >
> > My configs are:
> >
> > CONFIG_ARCH="risc-v"
> > CONFIG_ARCH_BOARD_CUSTOM=y
> > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> >
> > One version, where it fails is available publicly in
> >
> > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> >
> > Building "make ssrc_icicle_default". The board files are in
> > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > platforms/nuttx/Nuttx/nuttx.
> >
> > I didn't yet start looking into it in detail, what goes wrong, just
> > bisected the nuttx and reverted the commit which broke it for me. I need
> > to look back later to see how to change the off-tree board config to get
> > it back online.
> >
> > Just noticed that the error is somewhat similar, although coming from
> > different build env. But in my case it is likely that I need to adapt
> > the cmake build scripts according to the changes in nuttx.
> >
> > -Jukka
> >
> >
> >
> > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > Hello Jukka,
> > >
> > > So you experience the same problem as Daniel and reverting the commit helps?
> > >
> > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > based on SAME70 and after
> > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > running:
> > > 1. Synced "custom-board/scripts/Make.defs" with
> > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > 3. Removed files in my code tree that have exactly the same
> > > implementation as files from "boards/arm/samv7/common"
> > >
> > > It seems like Daniel is hitting the same issue, so I expect that
> > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > should fix the issue without any additional file clean-up.
> > > Please give me feedback if that helps.
> > >
> > > Best regards,
> > > Petro
> > >
> > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > >> HI,
> > >>
> > >> Not sure what is the correct way to fix this, but I reverted:
> > >>
> > >> "
> > >>
> > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > >> Author: Petro Karashchenko <pe...@gmail.com>
> > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > >>
> > >>       tools: add option to reuse boards common files for custom boards
> > >>
> > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > >> "
> > >>
> > >> Petro, what is the proper way to configure this?
> > >>
> > >> Thanks,
> > >>
> > >> Jukka
> > >>
> > >>
> > >>
> > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > >>
> > >>> Hi guys,
> > >>>
> > >>> I am having problems building custom boards outside of the Nuttx folder
> > >>> tree. Usually I use the following folder structure.
> > >>>
> > >>> |-> apps
> > >>> |-> my-folder
> > >>>      |-> my-apps
> > >>>         |-> custom-app
> > >>>      |-> my-boards
> > >>>         |-> custom-board
> > >>> |-> nuttx
> > >>>
> > >>> To build my apps I just need to create a symbolic link called external
> > >>> inside apps folder. To create a new custom board I start copying a similar
> > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > >>>
> > >>> *remove from defconfig:*
> > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > >>>
> > >>> *add on defconfig:*
> > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > >>>
> > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > >>>
> > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > >>> make I got the errors
> > >>>
> > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>> Create version.h
> > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > >>> make[2]: Entering directory
> > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > >>> Makefile:23: board/Make.defs: No such file or directory
> > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > >>> make[2]: Leaving directory
> > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > >>> make[1]: *** [Makefile:79: context] Error 2
> > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > >>>
> > >>> Does anyone know how to fix this problem?
> > >>>
> > >>> Thanks
> > >>>
> > >>> Daniel Pereira de Carvalho
> > >>>
>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hi Jukka,

I tried to replicate your case, but failed with:
$ git submodule update --init --recursive
Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
path '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'
failed
Failed to clone 'boards/ssrc/saluki-v1'. Retry scheduled
Cloning into '/home/pkarashchenko/workspace/px4-firmware/boards/ssrc/saluki-v1'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:tiiuae/saluki-v1.git' into submodule
path '/home/pkarashchenko$/workspace/px4-firmware/boards/ssrc/saluki-v1'
failed
Failed to clone 'boards/ssrc/saluki-v1' a second time, aborting

Best regards,
Petro

чт, 3 бер. 2022 р. о 09:34 Jukka Laitinen <ju...@iki.fi> пише:
>
> Hi,
>
> Maybe I was jumping in to conclusion and the issue is not the same as
> what I had. I was building PX4, which uses CMake build system, so I am
> not having any Makefile or Make.defs in my own board directory. Also the
> platform is not stm or arm, but risc-v.
>
> Anyhow, this is the error which I started getting in my build scripts:
>
> "
>
> ninja: error:
> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> make: *** [Makefile:225: ssrc_icicle_default] Error 1
> "
>
> My configs are:
>
> CONFIG_ARCH="risc-v"
> CONFIG_ARCH_BOARD_CUSTOM=y
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
>
> One version, where it fails is available publicly in
>
> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
>
> Building "make ssrc_icicle_default". The board files are in
> boards/ssrc/icicle/nuttx-config and NuttX cloned in
> platforms/nuttx/Nuttx/nuttx.
>
> I didn't yet start looking into it in detail, what goes wrong, just
> bisected the nuttx and reverted the commit which broke it for me. I need
> to look back later to see how to change the off-tree board config to get
> it back online.
>
> Just noticed that the error is somewhat similar, although coming from
> different build env. But in my case it is likely that I need to adapt
> the cmake build scripts according to the changes in nuttx.
>
> -Jukka
>
>
>
> On 3.3.2022 9.37, Petro Karashchenko wrote:
> > Hello Jukka,
> >
> > So you experience the same problem as Daniel and reverting the commit helps?
> >
> > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > reuse common code from "nuttx/board/...". I'm using a custom board
> > based on SAME70 and after
> > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > same as in "boards/arm/stm32". Here is what I did to get it back
> > running:
> > 1. Synced "custom-board/scripts/Make.defs" with
> > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > 3. Removed files in my code tree that have exactly the same
> > implementation as files from "boards/arm/samv7/common"
> >
> > It seems like Daniel is hitting the same issue, so I expect that
> > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > should fix the issue without any additional file clean-up.
> > Please give me feedback if that helps.
> >
> > Best regards,
> > Petro
> >
> > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> >> HI,
> >>
> >> Not sure what is the correct way to fix this, but I reverted:
> >>
> >> "
> >>
> >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> >> Author: Petro Karashchenko <pe...@gmail.com>
> >> Date:   Wed Jan 19 11:16:11 2022 +0200
> >>
> >>       tools: add option to reuse boards common files for custom boards
> >>
> >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> >> "
> >>
> >> Petro, what is the proper way to configure this?
> >>
> >> Thanks,
> >>
> >> Jukka
> >>
> >>
> >>
> >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> >>
> >>> Hi guys,
> >>>
> >>> I am having problems building custom boards outside of the Nuttx folder
> >>> tree. Usually I use the following folder structure.
> >>>
> >>> |-> apps
> >>> |-> my-folder
> >>>      |-> my-apps
> >>>         |-> custom-app
> >>>      |-> my-boards
> >>>         |-> custom-board
> >>> |-> nuttx
> >>>
> >>> To build my apps I just need to create a symbolic link called external
> >>> inside apps folder. To create a new custom board I start copying a similar
> >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> >>>
> >>> *remove from defconfig:*
> >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> >>>
> >>> *add on defconfig:*
> >>> CONFIG_ARCH_BOARD_CUSTOM=y
> >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> >>>
> >>> *Rename src/Make.defs to src/Makefile and append the line *
> >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> >>>
> >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> >>> make I got the errors
> >>>
> >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>> Create version.h
> >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> >>> make[2]: Entering directory
> >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>> Makefile:23: board/Make.defs: No such file or directory
> >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> >>> make[2]: Leaving directory
> >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>> make[1]: *** [Makefile:79: context] Error 2
> >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> >>>
> >>> Does anyone know how to fix this problem?
> >>>
> >>> Thanks
> >>>
> >>> Daniel Pereira de Carvalho
> >>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
If what you are writing is true, then compilation for any board that
does not have a "common" folder at board level should fail. And there
are plenty of boards in NuttX tree that compile without an error (CI
on mainline pass without any problems). I'm not saying that
"BOARD_COMMON_DIR" will not have a value. The case is will that value
be empty or not.

Best regards,
Petro

чт, 3 бер. 2022 р. о 11:32 Abdelatif Guettouche
<ab...@gmail.com> пише:
>
> > "Which is forcing a common directory when there isn't one. " -- This
> > statement is not true as we have
> > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > that depends on if "BOARD_COMMON_DIR" exists or not.
>
> Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
> a value, whether there is a common directory or not.
>
> On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> <pe...@gmail.com> wrote:
> >
> > Hello Abdelatif,
> >
> > "Which is forcing a common directory when there isn't one. " -- This
> > statement is not true as we have
> > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > that depends on if "BOARD_COMMON_DIR" exists or not.
> >
> > Getting back to original question:
> >
> > > To build my apps I just need to create a symbolic link called external
> > > inside apps folder. To create a new custom board I start copying a similar
> > > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > >
> > > *remove from defconfig:*
> > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > >
> > > *add on defconfig:*
> > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > >
> > > *Rename src/Make.defs to src/Makefile and append the line *
> > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > >
> > > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > make I got the errors
> >
> > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> >
> >    *Rename src/Make.defs to src/Makefile and append the line *
> >    include $(TOPDIR)/boards/Board.mk at the end of file.
> >
> > I will get back to errors met by Jukka to see what caused the problem
> > in his case.
> >
> > Best regards,
> > Petro
> >
> > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > <ab...@gmail.com> пише:
> > >
> > > > It seems like Daniel is hitting the same issue
> > >
> > > Daniel is actually not using the common folder from the STM32
> > > directory.  This is why he had to do that renaming.
> > > The issue is this:
> > > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > Which is forcing a common directory when there isn't one. This should
> > > not be done as people have requested before to be able to use boards
> > > without a common directory even if in-tree we use the common
> > > directory.
> > > Daniel, you can just remove those lines to confirm that it builds fine
> > > (I tried and it does, at least you don't have that error anymore,
> > > there are some trivial compile errors though in the board).
> > > For a final solution I think we can either remove them completely or
> > > just add an else statement. I didn't have time to think about it.
> > >
> > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > > >
> > > > Hi,
> > > >
> > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > platform is not stm or arm, but risc-v.
> > > >
> > > > Anyhow, this is the error which I started getting in my build scripts:
> > > >
> > > > "
> > > >
> > > > ninja: error:
> > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > "
> > > >
> > > > My configs are:
> > > >
> > > > CONFIG_ARCH="risc-v"
> > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > >
> > > > One version, where it fails is available publicly in
> > > >
> > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > >
> > > > Building "make ssrc_icicle_default". The board files are in
> > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > platforms/nuttx/Nuttx/nuttx.
> > > >
> > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > to look back later to see how to change the off-tree board config to get
> > > > it back online.
> > > >
> > > > Just noticed that the error is somewhat similar, although coming from
> > > > different build env. But in my case it is likely that I need to adapt
> > > > the cmake build scripts according to the changes in nuttx.
> > > >
> > > > -Jukka
> > > >
> > > >
> > > >
> > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > Hello Jukka,
> > > > >
> > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > >
> > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > based on SAME70 and after
> > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > running:
> > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > 3. Removed files in my code tree that have exactly the same
> > > > > implementation as files from "boards/arm/samv7/common"
> > > > >
> > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > should fix the issue without any additional file clean-up.
> > > > > Please give me feedback if that helps.
> > > > >
> > > > > Best regards,
> > > > > Petro
> > > > >
> > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > >> HI,
> > > > >>
> > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > >>
> > > > >> "
> > > > >>
> > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > >>
> > > > >>       tools: add option to reuse boards common files for custom boards
> > > > >>
> > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > >> "
> > > > >>
> > > > >> Petro, what is the proper way to configure this?
> > > > >>
> > > > >> Thanks,
> > > > >>
> > > > >> Jukka
> > > > >>
> > > > >>
> > > > >>
> > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > >>
> > > > >>> Hi guys,
> > > > >>>
> > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > >>> tree. Usually I use the following folder structure.
> > > > >>>
> > > > >>> |-> apps
> > > > >>> |-> my-folder
> > > > >>>      |-> my-apps
> > > > >>>         |-> custom-app
> > > > >>>      |-> my-boards
> > > > >>>         |-> custom-board
> > > > >>> |-> nuttx
> > > > >>>
> > > > >>> To build my apps I just need to create a symbolic link called external
> > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > >>>
> > > > >>> *remove from defconfig:*
> > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > >>>
> > > > >>> *add on defconfig:*
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > >>>
> > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > >>>
> > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > >>> make I got the errors
> > > > >>>
> > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> Create version.h
> > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > >>> make[2]: Entering directory
> > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > >>> make[2]: Leaving directory
> > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > >>>
> > > > >>> Does anyone know how to fix this problem?
> > > > >>>
> > > > >>> Thanks
> > > > >>>
> > > > >>> Daniel Pereira de Carvalho
> > > > >>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hi,

"I think in the current situation the symlink is created
unconditionally." -- yes. If the in-tree board has a common folder the
symlink points unconditionally to that location.

Introducing "CONFIG_ARCH_BOARD_COMMON" may be a good option here, so
the user can explicitly specify to create a symlink.

I will think about it a bit more, but most probably will submit a
change introducing "CONFIG_ARCH_BOARD_COMMON".

Best regards,
Petro

чт, 3 бер. 2022 р. о 14:23 Abdelatif Guettouche
<ab...@gmail.com> пише:
>
> > The case is only about creating a proper symlink.
>
> I think in the current situation the symlink is created unconditionally.
>
> > Abdelatif, I would really appreciate it if you can write and send me
> some small proposal at what level the option should exist.
>
> What I was referring to is similar to options like BOARD_STM32_COMMON.
> However, I was thinking of having only one that we can use in
> different places.  There are other boards, like ESP32, where there is
> no similar option. I haven't given this any time, so I don't know how
> well it would work.  I'd also be okay with these separate options but
> used consistently across all boards and defaulting all to 'n'.
> If this keeps the original behavior and as a bonus also removes those
> weird steps where we have to rename makefiles, then this is the best
> of both worlds.
>
> On Thu, Mar 3, 2022 at 2:01 PM Petro Karashchenko
> <pe...@gmail.com> wrote:
> >
> > The case is only about creating a proper symlink. "Again, the issue is
> > to not use the common folder at all." -- agin, that is possible. Each
> > "board/common" has options like "BOARD_STM32_COMMON" or
> > "BOARD_SAMV7_COMMON" and that is exactly to or not to use in-tree
> > "board/common". What other option do we need?
> >
> > "If users are requesting a feature, there isn't a stronger argument."
> > -- that is absolutely true and that is why I suggest to mark
> > https://github.com/apache/incubator-nuttx/pull/5274 as a "breaking
> > change" so users will be aware.
> > "We should leave the choice of using this folder or not to the user"
> > -- again, users have a choice over "BOARD_STM32_COMMON" or
> > "BOARD_SAMV7_COMMON". "BOARD_STM32_COMMON" is defaulted to "n" and I
> > will make a PR to default all similar options to "n".
> >
> > Let's discuss new option behavior if existing options do not satisfy a
> > use cases. I'm open to that, but for now I do not see a need for that
> > because IMO all options are already inplace.
> >
> > Abdelatif, I would really appreciate it if you can write and send me
> > some small proposal at what level the option should exist.
> >
> > Best regards,
> > Petro
> >
> > чт, 3 бер. 2022 р. о 13:48 Abdelatif Guettouche
> > <ab...@gmail.com> пише:
> > >
> > > > Compilation failed, but not because of a common folder but because:
> > >
> > > Again, the issue is to not use the common folder at all.  This was
> > > requested before.  What you did here is that you used the one in-tree.
> > >
> > > > I think this is a weak argument as we change config
> > > option names sometimes as users are forced to adapt their code.
> > >
> > > If users are requesting a feature, there isn't a stronger argument.
> > > Besides, this is not even a feature request, this is a restriction
> > > introduced by forcing the common folder to custom boards.
> > > They are called "custom" for a reason, they should not be restricted
> > > in this manner. We should leave the choice of using this folder or not
> > > to the user. As it was before.
> > > If we want to keep the option to share it for both in-tree and
> > > out-of-tree boards, then there has to be an _option_.  Not
> > > unconditionally forced.
> > > One solution is to introduce a new CONFIG_ that defaults to false.
> > >
> > >
> > >
> > >
> > > On Thu, Mar 3, 2022 at 1:20 PM Petro Karashchenko
> > > <pe...@gmail.com> wrote:
> > > >
> > > > Hello Abdelatif,
> > > >
> > > > I just tried to recreate the same scenario. To do this I did:
> > > > 1. Recreated folder structure as in Daniel's case
> > > > |-> apps
> > > > |-> my-folder
> > > >      |-> my-boards
> > > >        |-> custom-board
> > > > |-> nuttx
> > > >
> > > > 2. Copied  nucleo-g431kb to custom-board: cd my-folder/my-boards && cp
> > > > -r ../../nuttx/boards/arm/stm32/nucleo-g431kb custom-board
> > > >
> > > > 3. *remove from defconfig:*
> > > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > >
> > > > 4. *add on defconfig:*
> > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > >
> > > > 5. I did not performed: "*Rename src/Make.defs to src/Makefile and
> > > > append the line include $(TOPDIR)/boards/Board.mk at the end of
> > > > file.*"
> > > >
> > > > 6. tools/configure.sh ../my-folder/my-boards/custom-board/configs/nsh
> > > >
> > > > 7. make -j8
> > > >
> > > > Compilation failed, but not because of a common folder but because:
> > > > "board/stm32_userleds.c:60:14: error: 'BOARD_LED1' undeclared (first
> > > > use in this function); did you mean 'BOARD_LED2'?". So I had to "make
> > > > menuconfig" and select "BOARD_CUSTOM_LEDS" to pass compilation
> > > > successfully.
> > > >
> > > > "It could be that they have an old board where the common folder
> > > > structure didn't exist at the time and they don't want to change their
> > > > structure." -- I think this is a weak argument as we change config
> > > > option names sometimes as users are forced to adapt their code. The
> > > > only miss that I see here is that the
> > > > https://github.com/apache/incubator-nuttx/pull/5274 was not marked as
> > > > a "breaking change".
> > > >
> > > > Best regards,
> > > > Petro
> > > >
> > > > чт, 3 бер. 2022 р. о 11:57 Abdelatif Guettouche
> > > > <ab...@gmail.com> пише:
> > > > >
> > > > > > If what you are writing is true, then compilation for any board that
> > > > > > does not have a "common" folder at board level should fail.
> > > > >
> > > > > No because in-tree this line: BOARD_COMMON_DIR = $(wildcard
> > > > > $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)common)
> > > > > will result on an empty string.
> > > > >
> > > > > > We just need to copy source files from
> > > > > > NuttX board common to custom board location and add files to
> > > > > > compilation list
> > > > >
> > > > > The thing is that some people won't want to do that.  They don't want
> > > > > to use the common folder. It could be that they have an old board
> > > > > where the common folder structure didn't exist at the time and they
> > > > > don't want to change their structure.
> > > > >
> > > > > > Or maybe I'm missing the exact use case.
> > > > >
> > > > > Daniel's use case is the following: Use a custom board copied from an
> > > > > in-tree board _without_ using the common directory even if one exists.
> > > > >
> > > > > On Thu, Mar 3, 2022 at 11:43 AM Petro Karashchenko
> > > > > <pe...@gmail.com> wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > There is no problem with that. We just need to copy source files from
> > > > > > NuttX board common to custom board location and add files to
> > > > > > compilation list together with disabling of NuttX board common layer
> > > > > > (set CONFIG_BOARD_STM32_COMMON=n for example with STM32 case).
> > > > > >
> > > > > > Or maybe I'm missing the exact use case. If yes, then please describe
> > > > > > it more clearly and I will try to go through it to see if that can be
> > > > > > achieved with the current code tree or not.
> > > > > >
> > > > > > Best regards,
> > > > > > Petro
> > > > > >
> > > > > > чт, 3 бер. 2022 р. о 11:37 Abdelatif Guettouche
> > > > > > <ab...@gmail.com> пише:
> > > > > > >
> > > > > > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > > > > >
> > > > > > > These are necessary when someone is using a custom board without a
> > > > > > > common folder copied from a board in-tree that contains a common
> > > > > > > folder.
> > > > > > >
> > > > > > > On Thu, Mar 3, 2022 at 11:31 AM Abdelatif Guettouche
> > > > > > > <ab...@gmail.com> wrote:
> > > > > > > >
> > > > > > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > > > > > statement is not true as we have
> > > > > > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > > > > >
> > > > > > > > Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> > > > > > > > tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
> > > > > > > > a value, whether there is a common directory or not.
> > > > > > > >
> > > > > > > > On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> > > > > > > > <pe...@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > Hello Abdelatif,
> > > > > > > > >
> > > > > > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > > > > > statement is not true as we have
> > > > > > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > > > > > >
> > > > > > > > > Getting back to original question:
> > > > > > > > >
> > > > > > > > > > To build my apps I just need to create a symbolic link called external
> > > > > > > > > > inside apps folder. To create a new custom board I start copying a similar
> > > > > > > > > > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > > > > >
> > > > > > > > > > *remove from defconfig:*
> > > > > > > > > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > > > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > > > > >
> > > > > > > > > > *add on defconfig:*
> > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > > > > >
> > > > > > > > > > *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > > > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > > > >
> > > > > > > > > > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > > > > > make I got the errors
> > > > > > > > >
> > > > > > > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > > > > > > >
> > > > > > > > >    *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > > >    include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > > >
> > > > > > > > > I will get back to errors met by Jukka to see what caused the problem
> > > > > > > > > in his case.
> > > > > > > > >
> > > > > > > > > Best regards,
> > > > > > > > > Petro
> > > > > > > > >
> > > > > > > > > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > > > > > > > > <ab...@gmail.com> пише:
> > > > > > > > > >
> > > > > > > > > > > It seems like Daniel is hitting the same issue
> > > > > > > > > >
> > > > > > > > > > Daniel is actually not using the common folder from the STM32
> > > > > > > > > > directory.  This is why he had to do that renaming.
> > > > > > > > > > The issue is this:
> > > > > > > > > > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > > > > > > > > Which is forcing a common directory when there isn't one. This should
> > > > > > > > > > not be done as people have requested before to be able to use boards
> > > > > > > > > > without a common directory even if in-tree we use the common
> > > > > > > > > > directory.
> > > > > > > > > > Daniel, you can just remove those lines to confirm that it builds fine
> > > > > > > > > > (I tried and it does, at least you don't have that error anymore,
> > > > > > > > > > there are some trivial compile errors though in the board).
> > > > > > > > > > For a final solution I think we can either remove them completely or
> > > > > > > > > > just add an else statement. I didn't have time to think about it.
> > > > > > > > > >
> > > > > > > > > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hi,
> > > > > > > > > > >
> > > > > > > > > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > > > > > > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > > > > > > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > > > > > > > > platform is not stm or arm, but risc-v.
> > > > > > > > > > >
> > > > > > > > > > > Anyhow, this is the error which I started getting in my build scripts:
> > > > > > > > > > >
> > > > > > > > > > > "
> > > > > > > > > > >
> > > > > > > > > > > ninja: error:
> > > > > > > > > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > > > > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > > > > > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > > > > > > > "
> > > > > > > > > > >
> > > > > > > > > > > My configs are:
> > > > > > > > > > >
> > > > > > > > > > > CONFIG_ARCH="risc-v"
> > > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > > > > > > > >
> > > > > > > > > > > One version, where it fails is available publicly in
> > > > > > > > > > >
> > > > > > > > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > > > > > > > > >
> > > > > > > > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > > > > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > > > > > > > platforms/nuttx/Nuttx/nuttx.
> > > > > > > > > > >
> > > > > > > > > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > > > > > > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > > > > > > > > to look back later to see how to change the off-tree board config to get
> > > > > > > > > > > it back online.
> > > > > > > > > > >
> > > > > > > > > > > Just noticed that the error is somewhat similar, although coming from
> > > > > > > > > > > different build env. But in my case it is likely that I need to adapt
> > > > > > > > > > > the cmake build scripts according to the changes in nuttx.
> > > > > > > > > > >
> > > > > > > > > > > -Jukka
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > > > > > > > Hello Jukka,
> > > > > > > > > > > >
> > > > > > > > > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > > > > > > > > >
> > > > > > > > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > > > > > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > > > > > > > > based on SAME70 and after
> > > > > > > > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > > > > > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > > > > > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > > > > > > > > running:
> > > > > > > > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > > > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > > > > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > > > > > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > > > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > > > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > > > > > > > >
> > > > > > > > > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > > > > > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > > > > > > > > should fix the issue without any additional file clean-up.
> > > > > > > > > > > > Please give me feedback if that helps.
> > > > > > > > > > > >
> > > > > > > > > > > > Best regards,
> > > > > > > > > > > > Petro
> > > > > > > > > > > >
> > > > > > > > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > > > > > > > >> HI,
> > > > > > > > > > > >>
> > > > > > > > > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > > > > > > > > >>
> > > > > > > > > > > >> "
> > > > > > > > > > > >>
> > > > > > > > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > > > > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > > > > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > > > > > > > >>
> > > > > > > > > > > >>       tools: add option to reuse boards common files for custom boards
> > > > > > > > > > > >>
> > > > > > > > > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > > > > > > > > >> "
> > > > > > > > > > > >>
> > > > > > > > > > > >> Petro, what is the proper way to configure this?
> > > > > > > > > > > >>
> > > > > > > > > > > >> Thanks,
> > > > > > > > > > > >>
> > > > > > > > > > > >> Jukka
> > > > > > > > > > > >>
> > > > > > > > > > > >>
> > > > > > > > > > > >>
> > > > > > > > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > > > > > > > >>
> > > > > > > > > > > >>> Hi guys,
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > > > > > > > > >>> tree. Usually I use the following folder structure.
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> |-> apps
> > > > > > > > > > > >>> |-> my-folder
> > > > > > > > > > > >>>      |-> my-apps
> > > > > > > > > > > >>>         |-> custom-app
> > > > > > > > > > > >>>      |-> my-boards
> > > > > > > > > > > >>>         |-> custom-board
> > > > > > > > > > > >>> |-> nuttx
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> To build my apps I just need to create a symbolic link called external
> > > > > > > > > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > > > > > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> *remove from defconfig:*
> > > > > > > > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> *add on defconfig:*
> > > > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > > > > > > >>> make I got the errors
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > > > >>> Create version.h
> > > > > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > > > > >>> make[2]: Entering directory
> > > > > > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > > > > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > > > > > > > > >>> make[2]: Leaving directory
> > > > > > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> Does anyone know how to fix this problem?
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> Thanks
> > > > > > > > > > > >>>
> > > > > > > > > > > >>> Daniel Pereira de Carvalho
> > > > > > > > > > > >>>

Re: Error when building custom board

Posted by Abdelatif Guettouche <ab...@gmail.com>.
> The case is only about creating a proper symlink.

I think in the current situation the symlink is created unconditionally.

> Abdelatif, I would really appreciate it if you can write and send me
some small proposal at what level the option should exist.

What I was referring to is similar to options like BOARD_STM32_COMMON.
However, I was thinking of having only one that we can use in
different places.  There are other boards, like ESP32, where there is
no similar option. I haven't given this any time, so I don't know how
well it would work.  I'd also be okay with these separate options but
used consistently across all boards and defaulting all to 'n'.
If this keeps the original behavior and as a bonus also removes those
weird steps where we have to rename makefiles, then this is the best
of both worlds.

On Thu, Mar 3, 2022 at 2:01 PM Petro Karashchenko
<pe...@gmail.com> wrote:
>
> The case is only about creating a proper symlink. "Again, the issue is
> to not use the common folder at all." -- agin, that is possible. Each
> "board/common" has options like "BOARD_STM32_COMMON" or
> "BOARD_SAMV7_COMMON" and that is exactly to or not to use in-tree
> "board/common". What other option do we need?
>
> "If users are requesting a feature, there isn't a stronger argument."
> -- that is absolutely true and that is why I suggest to mark
> https://github.com/apache/incubator-nuttx/pull/5274 as a "breaking
> change" so users will be aware.
> "We should leave the choice of using this folder or not to the user"
> -- again, users have a choice over "BOARD_STM32_COMMON" or
> "BOARD_SAMV7_COMMON". "BOARD_STM32_COMMON" is defaulted to "n" and I
> will make a PR to default all similar options to "n".
>
> Let's discuss new option behavior if existing options do not satisfy a
> use cases. I'm open to that, but for now I do not see a need for that
> because IMO all options are already inplace.
>
> Abdelatif, I would really appreciate it if you can write and send me
> some small proposal at what level the option should exist.
>
> Best regards,
> Petro
>
> чт, 3 бер. 2022 р. о 13:48 Abdelatif Guettouche
> <ab...@gmail.com> пише:
> >
> > > Compilation failed, but not because of a common folder but because:
> >
> > Again, the issue is to not use the common folder at all.  This was
> > requested before.  What you did here is that you used the one in-tree.
> >
> > > I think this is a weak argument as we change config
> > option names sometimes as users are forced to adapt their code.
> >
> > If users are requesting a feature, there isn't a stronger argument.
> > Besides, this is not even a feature request, this is a restriction
> > introduced by forcing the common folder to custom boards.
> > They are called "custom" for a reason, they should not be restricted
> > in this manner. We should leave the choice of using this folder or not
> > to the user. As it was before.
> > If we want to keep the option to share it for both in-tree and
> > out-of-tree boards, then there has to be an _option_.  Not
> > unconditionally forced.
> > One solution is to introduce a new CONFIG_ that defaults to false.
> >
> >
> >
> >
> > On Thu, Mar 3, 2022 at 1:20 PM Petro Karashchenko
> > <pe...@gmail.com> wrote:
> > >
> > > Hello Abdelatif,
> > >
> > > I just tried to recreate the same scenario. To do this I did:
> > > 1. Recreated folder structure as in Daniel's case
> > > |-> apps
> > > |-> my-folder
> > >      |-> my-boards
> > >        |-> custom-board
> > > |-> nuttx
> > >
> > > 2. Copied  nucleo-g431kb to custom-board: cd my-folder/my-boards && cp
> > > -r ../../nuttx/boards/arm/stm32/nucleo-g431kb custom-board
> > >
> > > 3. *remove from defconfig:*
> > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > >
> > > 4. *add on defconfig:*
> > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > >
> > > 5. I did not performed: "*Rename src/Make.defs to src/Makefile and
> > > append the line include $(TOPDIR)/boards/Board.mk at the end of
> > > file.*"
> > >
> > > 6. tools/configure.sh ../my-folder/my-boards/custom-board/configs/nsh
> > >
> > > 7. make -j8
> > >
> > > Compilation failed, but not because of a common folder but because:
> > > "board/stm32_userleds.c:60:14: error: 'BOARD_LED1' undeclared (first
> > > use in this function); did you mean 'BOARD_LED2'?". So I had to "make
> > > menuconfig" and select "BOARD_CUSTOM_LEDS" to pass compilation
> > > successfully.
> > >
> > > "It could be that they have an old board where the common folder
> > > structure didn't exist at the time and they don't want to change their
> > > structure." -- I think this is a weak argument as we change config
> > > option names sometimes as users are forced to adapt their code. The
> > > only miss that I see here is that the
> > > https://github.com/apache/incubator-nuttx/pull/5274 was not marked as
> > > a "breaking change".
> > >
> > > Best regards,
> > > Petro
> > >
> > > чт, 3 бер. 2022 р. о 11:57 Abdelatif Guettouche
> > > <ab...@gmail.com> пише:
> > > >
> > > > > If what you are writing is true, then compilation for any board that
> > > > > does not have a "common" folder at board level should fail.
> > > >
> > > > No because in-tree this line: BOARD_COMMON_DIR = $(wildcard
> > > > $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)common)
> > > > will result on an empty string.
> > > >
> > > > > We just need to copy source files from
> > > > > NuttX board common to custom board location and add files to
> > > > > compilation list
> > > >
> > > > The thing is that some people won't want to do that.  They don't want
> > > > to use the common folder. It could be that they have an old board
> > > > where the common folder structure didn't exist at the time and they
> > > > don't want to change their structure.
> > > >
> > > > > Or maybe I'm missing the exact use case.
> > > >
> > > > Daniel's use case is the following: Use a custom board copied from an
> > > > in-tree board _without_ using the common directory even if one exists.
> > > >
> > > > On Thu, Mar 3, 2022 at 11:43 AM Petro Karashchenko
> > > > <pe...@gmail.com> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > There is no problem with that. We just need to copy source files from
> > > > > NuttX board common to custom board location and add files to
> > > > > compilation list together with disabling of NuttX board common layer
> > > > > (set CONFIG_BOARD_STM32_COMMON=n for example with STM32 case).
> > > > >
> > > > > Or maybe I'm missing the exact use case. If yes, then please describe
> > > > > it more clearly and I will try to go through it to see if that can be
> > > > > achieved with the current code tree or not.
> > > > >
> > > > > Best regards,
> > > > > Petro
> > > > >
> > > > > чт, 3 бер. 2022 р. о 11:37 Abdelatif Guettouche
> > > > > <ab...@gmail.com> пише:
> > > > > >
> > > > > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > > > >
> > > > > > These are necessary when someone is using a custom board without a
> > > > > > common folder copied from a board in-tree that contains a common
> > > > > > folder.
> > > > > >
> > > > > > On Thu, Mar 3, 2022 at 11:31 AM Abdelatif Guettouche
> > > > > > <ab...@gmail.com> wrote:
> > > > > > >
> > > > > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > > > > statement is not true as we have
> > > > > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > > > >
> > > > > > > Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> > > > > > > tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
> > > > > > > a value, whether there is a common directory or not.
> > > > > > >
> > > > > > > On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> > > > > > > <pe...@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Hello Abdelatif,
> > > > > > > >
> > > > > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > > > > statement is not true as we have
> > > > > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > > > > >
> > > > > > > > Getting back to original question:
> > > > > > > >
> > > > > > > > > To build my apps I just need to create a symbolic link called external
> > > > > > > > > inside apps folder. To create a new custom board I start copying a similar
> > > > > > > > > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > > > >
> > > > > > > > > *remove from defconfig:*
> > > > > > > > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > > > >
> > > > > > > > > *add on defconfig:*
> > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > > > >
> > > > > > > > > *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > > >
> > > > > > > > > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > > > > make I got the errors
> > > > > > > >
> > > > > > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > > > > > >
> > > > > > > >    *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > >    include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > >
> > > > > > > > I will get back to errors met by Jukka to see what caused the problem
> > > > > > > > in his case.
> > > > > > > >
> > > > > > > > Best regards,
> > > > > > > > Petro
> > > > > > > >
> > > > > > > > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > > > > > > > <ab...@gmail.com> пише:
> > > > > > > > >
> > > > > > > > > > It seems like Daniel is hitting the same issue
> > > > > > > > >
> > > > > > > > > Daniel is actually not using the common folder from the STM32
> > > > > > > > > directory.  This is why he had to do that renaming.
> > > > > > > > > The issue is this:
> > > > > > > > > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > > > > > > > Which is forcing a common directory when there isn't one. This should
> > > > > > > > > not be done as people have requested before to be able to use boards
> > > > > > > > > without a common directory even if in-tree we use the common
> > > > > > > > > directory.
> > > > > > > > > Daniel, you can just remove those lines to confirm that it builds fine
> > > > > > > > > (I tried and it does, at least you don't have that error anymore,
> > > > > > > > > there are some trivial compile errors though in the board).
> > > > > > > > > For a final solution I think we can either remove them completely or
> > > > > > > > > just add an else statement. I didn't have time to think about it.
> > > > > > > > >
> > > > > > > > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > > > > > > > > >
> > > > > > > > > > Hi,
> > > > > > > > > >
> > > > > > > > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > > > > > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > > > > > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > > > > > > > platform is not stm or arm, but risc-v.
> > > > > > > > > >
> > > > > > > > > > Anyhow, this is the error which I started getting in my build scripts:
> > > > > > > > > >
> > > > > > > > > > "
> > > > > > > > > >
> > > > > > > > > > ninja: error:
> > > > > > > > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > > > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > > > > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > > > > > > "
> > > > > > > > > >
> > > > > > > > > > My configs are:
> > > > > > > > > >
> > > > > > > > > > CONFIG_ARCH="risc-v"
> > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > > > > > > >
> > > > > > > > > > One version, where it fails is available publicly in
> > > > > > > > > >
> > > > > > > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > > > > > > > >
> > > > > > > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > > > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > > > > > > platforms/nuttx/Nuttx/nuttx.
> > > > > > > > > >
> > > > > > > > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > > > > > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > > > > > > > to look back later to see how to change the off-tree board config to get
> > > > > > > > > > it back online.
> > > > > > > > > >
> > > > > > > > > > Just noticed that the error is somewhat similar, although coming from
> > > > > > > > > > different build env. But in my case it is likely that I need to adapt
> > > > > > > > > > the cmake build scripts according to the changes in nuttx.
> > > > > > > > > >
> > > > > > > > > > -Jukka
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > > > > > > Hello Jukka,
> > > > > > > > > > >
> > > > > > > > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > > > > > > > >
> > > > > > > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > > > > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > > > > > > > based on SAME70 and after
> > > > > > > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > > > > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > > > > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > > > > > > > running:
> > > > > > > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > > > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > > > > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > > > > > > >
> > > > > > > > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > > > > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > > > > > > > should fix the issue without any additional file clean-up.
> > > > > > > > > > > Please give me feedback if that helps.
> > > > > > > > > > >
> > > > > > > > > > > Best regards,
> > > > > > > > > > > Petro
> > > > > > > > > > >
> > > > > > > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > > > > > > >> HI,
> > > > > > > > > > >>
> > > > > > > > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > > > > > > > >>
> > > > > > > > > > >> "
> > > > > > > > > > >>
> > > > > > > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > > > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > > > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > > > > > > >>
> > > > > > > > > > >>       tools: add option to reuse boards common files for custom boards
> > > > > > > > > > >>
> > > > > > > > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > > > > > > > >> "
> > > > > > > > > > >>
> > > > > > > > > > >> Petro, what is the proper way to configure this?
> > > > > > > > > > >>
> > > > > > > > > > >> Thanks,
> > > > > > > > > > >>
> > > > > > > > > > >> Jukka
> > > > > > > > > > >>
> > > > > > > > > > >>
> > > > > > > > > > >>
> > > > > > > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > > > > > > >>
> > > > > > > > > > >>> Hi guys,
> > > > > > > > > > >>>
> > > > > > > > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > > > > > > > >>> tree. Usually I use the following folder structure.
> > > > > > > > > > >>>
> > > > > > > > > > >>> |-> apps
> > > > > > > > > > >>> |-> my-folder
> > > > > > > > > > >>>      |-> my-apps
> > > > > > > > > > >>>         |-> custom-app
> > > > > > > > > > >>>      |-> my-boards
> > > > > > > > > > >>>         |-> custom-board
> > > > > > > > > > >>> |-> nuttx
> > > > > > > > > > >>>
> > > > > > > > > > >>> To build my apps I just need to create a symbolic link called external
> > > > > > > > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > > > > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > > > > > >>>
> > > > > > > > > > >>> *remove from defconfig:*
> > > > > > > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > > > > > >>>
> > > > > > > > > > >>> *add on defconfig:*
> > > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > > > > > >>>
> > > > > > > > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > > > > >>>
> > > > > > > > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > > > > > >>> make I got the errors
> > > > > > > > > > >>>
> > > > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > > >>> Create version.h
> > > > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > > > >>> make[2]: Entering directory
> > > > > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > > > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > > > > > > > >>> make[2]: Leaving directory
> > > > > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > > > > > > >>>
> > > > > > > > > > >>> Does anyone know how to fix this problem?
> > > > > > > > > > >>>
> > > > > > > > > > >>> Thanks
> > > > > > > > > > >>>
> > > > > > > > > > >>> Daniel Pereira de Carvalho
> > > > > > > > > > >>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
The case is only about creating a proper symlink. "Again, the issue is
to not use the common folder at all." -- agin, that is possible. Each
"board/common" has options like "BOARD_STM32_COMMON" or
"BOARD_SAMV7_COMMON" and that is exactly to or not to use in-tree
"board/common". What other option do we need?

"If users are requesting a feature, there isn't a stronger argument."
-- that is absolutely true and that is why I suggest to mark
https://github.com/apache/incubator-nuttx/pull/5274 as a "breaking
change" so users will be aware.
"We should leave the choice of using this folder or not to the user"
-- again, users have a choice over "BOARD_STM32_COMMON" or
"BOARD_SAMV7_COMMON". "BOARD_STM32_COMMON" is defaulted to "n" and I
will make a PR to default all similar options to "n".

Let's discuss new option behavior if existing options do not satisfy a
use cases. I'm open to that, but for now I do not see a need for that
because IMO all options are already inplace.

Abdelatif, I would really appreciate it if you can write and send me
some small proposal at what level the option should exist.

Best regards,
Petro

чт, 3 бер. 2022 р. о 13:48 Abdelatif Guettouche
<ab...@gmail.com> пише:
>
> > Compilation failed, but not because of a common folder but because:
>
> Again, the issue is to not use the common folder at all.  This was
> requested before.  What you did here is that you used the one in-tree.
>
> > I think this is a weak argument as we change config
> option names sometimes as users are forced to adapt their code.
>
> If users are requesting a feature, there isn't a stronger argument.
> Besides, this is not even a feature request, this is a restriction
> introduced by forcing the common folder to custom boards.
> They are called "custom" for a reason, they should not be restricted
> in this manner. We should leave the choice of using this folder or not
> to the user. As it was before.
> If we want to keep the option to share it for both in-tree and
> out-of-tree boards, then there has to be an _option_.  Not
> unconditionally forced.
> One solution is to introduce a new CONFIG_ that defaults to false.
>
>
>
>
> On Thu, Mar 3, 2022 at 1:20 PM Petro Karashchenko
> <pe...@gmail.com> wrote:
> >
> > Hello Abdelatif,
> >
> > I just tried to recreate the same scenario. To do this I did:
> > 1. Recreated folder structure as in Daniel's case
> > |-> apps
> > |-> my-folder
> >      |-> my-boards
> >        |-> custom-board
> > |-> nuttx
> >
> > 2. Copied  nucleo-g431kb to custom-board: cd my-folder/my-boards && cp
> > -r ../../nuttx/boards/arm/stm32/nucleo-g431kb custom-board
> >
> > 3. *remove from defconfig:*
> > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> >
> > 4. *add on defconfig:*
> > CONFIG_ARCH_BOARD_CUSTOM=y
> > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> >
> > 5. I did not performed: "*Rename src/Make.defs to src/Makefile and
> > append the line include $(TOPDIR)/boards/Board.mk at the end of
> > file.*"
> >
> > 6. tools/configure.sh ../my-folder/my-boards/custom-board/configs/nsh
> >
> > 7. make -j8
> >
> > Compilation failed, but not because of a common folder but because:
> > "board/stm32_userleds.c:60:14: error: 'BOARD_LED1' undeclared (first
> > use in this function); did you mean 'BOARD_LED2'?". So I had to "make
> > menuconfig" and select "BOARD_CUSTOM_LEDS" to pass compilation
> > successfully.
> >
> > "It could be that they have an old board where the common folder
> > structure didn't exist at the time and they don't want to change their
> > structure." -- I think this is a weak argument as we change config
> > option names sometimes as users are forced to adapt their code. The
> > only miss that I see here is that the
> > https://github.com/apache/incubator-nuttx/pull/5274 was not marked as
> > a "breaking change".
> >
> > Best regards,
> > Petro
> >
> > чт, 3 бер. 2022 р. о 11:57 Abdelatif Guettouche
> > <ab...@gmail.com> пише:
> > >
> > > > If what you are writing is true, then compilation for any board that
> > > > does not have a "common" folder at board level should fail.
> > >
> > > No because in-tree this line: BOARD_COMMON_DIR = $(wildcard
> > > $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)common)
> > > will result on an empty string.
> > >
> > > > We just need to copy source files from
> > > > NuttX board common to custom board location and add files to
> > > > compilation list
> > >
> > > The thing is that some people won't want to do that.  They don't want
> > > to use the common folder. It could be that they have an old board
> > > where the common folder structure didn't exist at the time and they
> > > don't want to change their structure.
> > >
> > > > Or maybe I'm missing the exact use case.
> > >
> > > Daniel's use case is the following: Use a custom board copied from an
> > > in-tree board _without_ using the common directory even if one exists.
> > >
> > > On Thu, Mar 3, 2022 at 11:43 AM Petro Karashchenko
> > > <pe...@gmail.com> wrote:
> > > >
> > > > Hi,
> > > >
> > > > There is no problem with that. We just need to copy source files from
> > > > NuttX board common to custom board location and add files to
> > > > compilation list together with disabling of NuttX board common layer
> > > > (set CONFIG_BOARD_STM32_COMMON=n for example with STM32 case).
> > > >
> > > > Or maybe I'm missing the exact use case. If yes, then please describe
> > > > it more clearly and I will try to go through it to see if that can be
> > > > achieved with the current code tree or not.
> > > >
> > > > Best regards,
> > > > Petro
> > > >
> > > > чт, 3 бер. 2022 р. о 11:37 Abdelatif Guettouche
> > > > <ab...@gmail.com> пише:
> > > > >
> > > > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > > >
> > > > > These are necessary when someone is using a custom board without a
> > > > > common folder copied from a board in-tree that contains a common
> > > > > folder.
> > > > >
> > > > > On Thu, Mar 3, 2022 at 11:31 AM Abdelatif Guettouche
> > > > > <ab...@gmail.com> wrote:
> > > > > >
> > > > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > > > statement is not true as we have
> > > > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > > >
> > > > > > Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> > > > > > tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
> > > > > > a value, whether there is a common directory or not.
> > > > > >
> > > > > > On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> > > > > > <pe...@gmail.com> wrote:
> > > > > > >
> > > > > > > Hello Abdelatif,
> > > > > > >
> > > > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > > > statement is not true as we have
> > > > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > > > >
> > > > > > > Getting back to original question:
> > > > > > >
> > > > > > > > To build my apps I just need to create a symbolic link called external
> > > > > > > > inside apps folder. To create a new custom board I start copying a similar
> > > > > > > > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > > >
> > > > > > > > *remove from defconfig:*
> > > > > > > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > > >
> > > > > > > > *add on defconfig:*
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > > >
> > > > > > > > *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > >
> > > > > > > > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > > > make I got the errors
> > > > > > >
> > > > > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > > > > >
> > > > > > >    *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > >    include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > >
> > > > > > > I will get back to errors met by Jukka to see what caused the problem
> > > > > > > in his case.
> > > > > > >
> > > > > > > Best regards,
> > > > > > > Petro
> > > > > > >
> > > > > > > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > > > > > > <ab...@gmail.com> пише:
> > > > > > > >
> > > > > > > > > It seems like Daniel is hitting the same issue
> > > > > > > >
> > > > > > > > Daniel is actually not using the common folder from the STM32
> > > > > > > > directory.  This is why he had to do that renaming.
> > > > > > > > The issue is this:
> > > > > > > > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > > > > > > Which is forcing a common directory when there isn't one. This should
> > > > > > > > not be done as people have requested before to be able to use boards
> > > > > > > > without a common directory even if in-tree we use the common
> > > > > > > > directory.
> > > > > > > > Daniel, you can just remove those lines to confirm that it builds fine
> > > > > > > > (I tried and it does, at least you don't have that error anymore,
> > > > > > > > there are some trivial compile errors though in the board).
> > > > > > > > For a final solution I think we can either remove them completely or
> > > > > > > > just add an else statement. I didn't have time to think about it.
> > > > > > > >
> > > > > > > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > > > > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > > > > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > > > > > > platform is not stm or arm, but risc-v.
> > > > > > > > >
> > > > > > > > > Anyhow, this is the error which I started getting in my build scripts:
> > > > > > > > >
> > > > > > > > > "
> > > > > > > > >
> > > > > > > > > ninja: error:
> > > > > > > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > > > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > > > > > "
> > > > > > > > >
> > > > > > > > > My configs are:
> > > > > > > > >
> > > > > > > > > CONFIG_ARCH="risc-v"
> > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > > > > > >
> > > > > > > > > One version, where it fails is available publicly in
> > > > > > > > >
> > > > > > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > > > > > > >
> > > > > > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > > > > > platforms/nuttx/Nuttx/nuttx.
> > > > > > > > >
> > > > > > > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > > > > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > > > > > > to look back later to see how to change the off-tree board config to get
> > > > > > > > > it back online.
> > > > > > > > >
> > > > > > > > > Just noticed that the error is somewhat similar, although coming from
> > > > > > > > > different build env. But in my case it is likely that I need to adapt
> > > > > > > > > the cmake build scripts according to the changes in nuttx.
> > > > > > > > >
> > > > > > > > > -Jukka
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > > > > > Hello Jukka,
> > > > > > > > > >
> > > > > > > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > > > > > > >
> > > > > > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > > > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > > > > > > based on SAME70 and after
> > > > > > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > > > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > > > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > > > > > > running:
> > > > > > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > > > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > > > > > >
> > > > > > > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > > > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > > > > > > should fix the issue without any additional file clean-up.
> > > > > > > > > > Please give me feedback if that helps.
> > > > > > > > > >
> > > > > > > > > > Best regards,
> > > > > > > > > > Petro
> > > > > > > > > >
> > > > > > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > > > > > >> HI,
> > > > > > > > > >>
> > > > > > > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > > > > > > >>
> > > > > > > > > >> "
> > > > > > > > > >>
> > > > > > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > > > > > >>
> > > > > > > > > >>       tools: add option to reuse boards common files for custom boards
> > > > > > > > > >>
> > > > > > > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > > > > > > >> "
> > > > > > > > > >>
> > > > > > > > > >> Petro, what is the proper way to configure this?
> > > > > > > > > >>
> > > > > > > > > >> Thanks,
> > > > > > > > > >>
> > > > > > > > > >> Jukka
> > > > > > > > > >>
> > > > > > > > > >>
> > > > > > > > > >>
> > > > > > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > > > > > >>
> > > > > > > > > >>> Hi guys,
> > > > > > > > > >>>
> > > > > > > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > > > > > > >>> tree. Usually I use the following folder structure.
> > > > > > > > > >>>
> > > > > > > > > >>> |-> apps
> > > > > > > > > >>> |-> my-folder
> > > > > > > > > >>>      |-> my-apps
> > > > > > > > > >>>         |-> custom-app
> > > > > > > > > >>>      |-> my-boards
> > > > > > > > > >>>         |-> custom-board
> > > > > > > > > >>> |-> nuttx
> > > > > > > > > >>>
> > > > > > > > > >>> To build my apps I just need to create a symbolic link called external
> > > > > > > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > > > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > > > > >>>
> > > > > > > > > >>> *remove from defconfig:*
> > > > > > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > > > > >>>
> > > > > > > > > >>> *add on defconfig:*
> > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > > > > >>>
> > > > > > > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > > > >>>
> > > > > > > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > > > > >>> make I got the errors
> > > > > > > > > >>>
> > > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > > >>> Create version.h
> > > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > > >>> make[2]: Entering directory
> > > > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > > > > > > >>> make[2]: Leaving directory
> > > > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > > > > > >>>
> > > > > > > > > >>> Does anyone know how to fix this problem?
> > > > > > > > > >>>
> > > > > > > > > >>> Thanks
> > > > > > > > > >>>
> > > > > > > > > >>> Daniel Pereira de Carvalho
> > > > > > > > > >>>

Re: Error when building custom board

Posted by Abdelatif Guettouche <ab...@gmail.com>.
> Compilation failed, but not because of a common folder but because:

Again, the issue is to not use the common folder at all.  This was
requested before.  What you did here is that you used the one in-tree.

> I think this is a weak argument as we change config
option names sometimes as users are forced to adapt their code.

If users are requesting a feature, there isn't a stronger argument.
Besides, this is not even a feature request, this is a restriction
introduced by forcing the common folder to custom boards.
They are called "custom" for a reason, they should not be restricted
in this manner. We should leave the choice of using this folder or not
to the user. As it was before.
If we want to keep the option to share it for both in-tree and
out-of-tree boards, then there has to be an _option_.  Not
unconditionally forced.
One solution is to introduce a new CONFIG_ that defaults to false.




On Thu, Mar 3, 2022 at 1:20 PM Petro Karashchenko
<pe...@gmail.com> wrote:
>
> Hello Abdelatif,
>
> I just tried to recreate the same scenario. To do this I did:
> 1. Recreated folder structure as in Daniel's case
> |-> apps
> |-> my-folder
>      |-> my-boards
>        |-> custom-board
> |-> nuttx
>
> 2. Copied  nucleo-g431kb to custom-board: cd my-folder/my-boards && cp
> -r ../../nuttx/boards/arm/stm32/nucleo-g431kb custom-board
>
> 3. *remove from defconfig:*
> CONFIG_ARCH_BOARD="nucleo-g431kb"
> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
>
> 4. *add on defconfig:*
> CONFIG_ARCH_BOARD_CUSTOM=y
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
>
> 5. I did not performed: "*Rename src/Make.defs to src/Makefile and
> append the line include $(TOPDIR)/boards/Board.mk at the end of
> file.*"
>
> 6. tools/configure.sh ../my-folder/my-boards/custom-board/configs/nsh
>
> 7. make -j8
>
> Compilation failed, but not because of a common folder but because:
> "board/stm32_userleds.c:60:14: error: 'BOARD_LED1' undeclared (first
> use in this function); did you mean 'BOARD_LED2'?". So I had to "make
> menuconfig" and select "BOARD_CUSTOM_LEDS" to pass compilation
> successfully.
>
> "It could be that they have an old board where the common folder
> structure didn't exist at the time and they don't want to change their
> structure." -- I think this is a weak argument as we change config
> option names sometimes as users are forced to adapt their code. The
> only miss that I see here is that the
> https://github.com/apache/incubator-nuttx/pull/5274 was not marked as
> a "breaking change".
>
> Best regards,
> Petro
>
> чт, 3 бер. 2022 р. о 11:57 Abdelatif Guettouche
> <ab...@gmail.com> пише:
> >
> > > If what you are writing is true, then compilation for any board that
> > > does not have a "common" folder at board level should fail.
> >
> > No because in-tree this line: BOARD_COMMON_DIR = $(wildcard
> > $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)common)
> > will result on an empty string.
> >
> > > We just need to copy source files from
> > > NuttX board common to custom board location and add files to
> > > compilation list
> >
> > The thing is that some people won't want to do that.  They don't want
> > to use the common folder. It could be that they have an old board
> > where the common folder structure didn't exist at the time and they
> > don't want to change their structure.
> >
> > > Or maybe I'm missing the exact use case.
> >
> > Daniel's use case is the following: Use a custom board copied from an
> > in-tree board _without_ using the common directory even if one exists.
> >
> > On Thu, Mar 3, 2022 at 11:43 AM Petro Karashchenko
> > <pe...@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > There is no problem with that. We just need to copy source files from
> > > NuttX board common to custom board location and add files to
> > > compilation list together with disabling of NuttX board common layer
> > > (set CONFIG_BOARD_STM32_COMMON=n for example with STM32 case).
> > >
> > > Or maybe I'm missing the exact use case. If yes, then please describe
> > > it more clearly and I will try to go through it to see if that can be
> > > achieved with the current code tree or not.
> > >
> > > Best regards,
> > > Petro
> > >
> > > чт, 3 бер. 2022 р. о 11:37 Abdelatif Guettouche
> > > <ab...@gmail.com> пише:
> > > >
> > > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > >
> > > > These are necessary when someone is using a custom board without a
> > > > common folder copied from a board in-tree that contains a common
> > > > folder.
> > > >
> > > > On Thu, Mar 3, 2022 at 11:31 AM Abdelatif Guettouche
> > > > <ab...@gmail.com> wrote:
> > > > >
> > > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > > statement is not true as we have
> > > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > >
> > > > > Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> > > > > tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
> > > > > a value, whether there is a common directory or not.
> > > > >
> > > > > On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> > > > > <pe...@gmail.com> wrote:
> > > > > >
> > > > > > Hello Abdelatif,
> > > > > >
> > > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > > statement is not true as we have
> > > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > > >
> > > > > > Getting back to original question:
> > > > > >
> > > > > > > To build my apps I just need to create a symbolic link called external
> > > > > > > inside apps folder. To create a new custom board I start copying a similar
> > > > > > > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > >
> > > > > > > *remove from defconfig:*
> > > > > > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > >
> > > > > > > *add on defconfig:*
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > >
> > > > > > > *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > >
> > > > > > > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > > make I got the errors
> > > > > >
> > > > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > > > >
> > > > > >    *Rename src/Make.defs to src/Makefile and append the line *
> > > > > >    include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > >
> > > > > > I will get back to errors met by Jukka to see what caused the problem
> > > > > > in his case.
> > > > > >
> > > > > > Best regards,
> > > > > > Petro
> > > > > >
> > > > > > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > > > > > <ab...@gmail.com> пише:
> > > > > > >
> > > > > > > > It seems like Daniel is hitting the same issue
> > > > > > >
> > > > > > > Daniel is actually not using the common folder from the STM32
> > > > > > > directory.  This is why he had to do that renaming.
> > > > > > > The issue is this:
> > > > > > > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > > > > > Which is forcing a common directory when there isn't one. This should
> > > > > > > not be done as people have requested before to be able to use boards
> > > > > > > without a common directory even if in-tree we use the common
> > > > > > > directory.
> > > > > > > Daniel, you can just remove those lines to confirm that it builds fine
> > > > > > > (I tried and it does, at least you don't have that error anymore,
> > > > > > > there are some trivial compile errors though in the board).
> > > > > > > For a final solution I think we can either remove them completely or
> > > > > > > just add an else statement. I didn't have time to think about it.
> > > > > > >
> > > > > > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > > > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > > > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > > > > > platform is not stm or arm, but risc-v.
> > > > > > > >
> > > > > > > > Anyhow, this is the error which I started getting in my build scripts:
> > > > > > > >
> > > > > > > > "
> > > > > > > >
> > > > > > > > ninja: error:
> > > > > > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > > > > "
> > > > > > > >
> > > > > > > > My configs are:
> > > > > > > >
> > > > > > > > CONFIG_ARCH="risc-v"
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > > > > >
> > > > > > > > One version, where it fails is available publicly in
> > > > > > > >
> > > > > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > > > > > >
> > > > > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > > > > platforms/nuttx/Nuttx/nuttx.
> > > > > > > >
> > > > > > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > > > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > > > > > to look back later to see how to change the off-tree board config to get
> > > > > > > > it back online.
> > > > > > > >
> > > > > > > > Just noticed that the error is somewhat similar, although coming from
> > > > > > > > different build env. But in my case it is likely that I need to adapt
> > > > > > > > the cmake build scripts according to the changes in nuttx.
> > > > > > > >
> > > > > > > > -Jukka
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > > > > Hello Jukka,
> > > > > > > > >
> > > > > > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > > > > > >
> > > > > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > > > > > based on SAME70 and after
> > > > > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > > > > > running:
> > > > > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > > > > >
> > > > > > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > > > > > should fix the issue without any additional file clean-up.
> > > > > > > > > Please give me feedback if that helps.
> > > > > > > > >
> > > > > > > > > Best regards,
> > > > > > > > > Petro
> > > > > > > > >
> > > > > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > > > > >> HI,
> > > > > > > > >>
> > > > > > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > > > > > >>
> > > > > > > > >> "
> > > > > > > > >>
> > > > > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > > > > >>
> > > > > > > > >>       tools: add option to reuse boards common files for custom boards
> > > > > > > > >>
> > > > > > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > > > > > >> "
> > > > > > > > >>
> > > > > > > > >> Petro, what is the proper way to configure this?
> > > > > > > > >>
> > > > > > > > >> Thanks,
> > > > > > > > >>
> > > > > > > > >> Jukka
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > > > > >>
> > > > > > > > >>> Hi guys,
> > > > > > > > >>>
> > > > > > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > > > > > >>> tree. Usually I use the following folder structure.
> > > > > > > > >>>
> > > > > > > > >>> |-> apps
> > > > > > > > >>> |-> my-folder
> > > > > > > > >>>      |-> my-apps
> > > > > > > > >>>         |-> custom-app
> > > > > > > > >>>      |-> my-boards
> > > > > > > > >>>         |-> custom-board
> > > > > > > > >>> |-> nuttx
> > > > > > > > >>>
> > > > > > > > >>> To build my apps I just need to create a symbolic link called external
> > > > > > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > > > >>>
> > > > > > > > >>> *remove from defconfig:*
> > > > > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > > > >>>
> > > > > > > > >>> *add on defconfig:*
> > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > > > >>>
> > > > > > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > > >>>
> > > > > > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > > > >>> make I got the errors
> > > > > > > > >>>
> > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > >>> Create version.h
> > > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > >>> make[2]: Entering directory
> > > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > > > > > >>> make[2]: Leaving directory
> > > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > > > > >>>
> > > > > > > > >>> Does anyone know how to fix this problem?
> > > > > > > > >>>
> > > > > > > > >>> Thanks
> > > > > > > > >>>
> > > > > > > > >>> Daniel Pereira de Carvalho
> > > > > > > > >>>

Re: Error when building custom board

Posted by Daniel Pereira Carvalho <da...@gmail.com>.
 Hi Petro,

I forgot to mention that I need to enable BOARD_CUSTOM_LEDS, sorry about
that. Now I was able to build without errors keeping src/Make.defs
untouched.

Thanks everybody

Daniel Pereira de Carvalho


Em qui., 3 de mar. de 2022 às 09:20, Petro Karashchenko <
petro.karashchenko@gmail.com> escreveu:

> Hello Abdelatif,
>
> I just tried to recreate the same scenario. To do this I did:
> 1. Recreated folder structure as in Daniel's case
> |-> apps
> |-> my-folder
>      |-> my-boards
>        |-> custom-board
> |-> nuttx
>
> 2. Copied  nucleo-g431kb to custom-board: cd my-folder/my-boards && cp
> -r ../../nuttx/boards/arm/stm32/nucleo-g431kb custom-board
>
> 3. *remove from defconfig:*
> CONFIG_ARCH_BOARD="nucleo-g431kb"
> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
>
> 4. *add on defconfig:*
> CONFIG_ARCH_BOARD_CUSTOM=y
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
>
> 5. I did not performed: "*Rename src/Make.defs to src/Makefile and
> append the line include $(TOPDIR)/boards/Board.mk at the end of
> file.*"
>
> 6. tools/configure.sh ../my-folder/my-boards/custom-board/configs/nsh
>
> 7. make -j8
>
> Compilation failed, but not because of a common folder but because:
> "board/stm32_userleds.c:60:14: error: 'BOARD_LED1' undeclared (first
> use in this function); did you mean 'BOARD_LED2'?". So I had to "make
> menuconfig" and select "BOARD_CUSTOM_LEDS" to pass compilation
> successfully.
>
> "It could be that they have an old board where the common folder
> structure didn't exist at the time and they don't want to change their
> structure." -- I think this is a weak argument as we change config
> option names sometimes as users are forced to adapt their code. The
> only miss that I see here is that the
> https://github.com/apache/incubator-nuttx/pull/5274 was not marked as
> a "breaking change".
>
> Best regards,
> Petro
>
> чт, 3 бер. 2022 р. о 11:57 Abdelatif Guettouche
> <ab...@gmail.com> пише:
> >
> > > If what you are writing is true, then compilation for any board that
> > > does not have a "common" folder at board level should fail.
> >
> > No because in-tree this line: BOARD_COMMON_DIR = $(wildcard
> >
> $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)common)
> > will result on an empty string.
> >
> > > We just need to copy source files from
> > > NuttX board common to custom board location and add files to
> > > compilation list
> >
> > The thing is that some people won't want to do that.  They don't want
> > to use the common folder. It could be that they have an old board
> > where the common folder structure didn't exist at the time and they
> > don't want to change their structure.
> >
> > > Or maybe I'm missing the exact use case.
> >
> > Daniel's use case is the following: Use a custom board copied from an
> > in-tree board _without_ using the common directory even if one exists.
> >
> > On Thu, Mar 3, 2022 at 11:43 AM Petro Karashchenko
> > <pe...@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > There is no problem with that. We just need to copy source files from
> > > NuttX board common to custom board location and add files to
> > > compilation list together with disabling of NuttX board common layer
> > > (set CONFIG_BOARD_STM32_COMMON=n for example with STM32 case).
> > >
> > > Or maybe I'm missing the exact use case. If yes, then please describe
> > > it more clearly and I will try to go through it to see if that can be
> > > achieved with the current code tree or not.
> > >
> > > Best regards,
> > > Petro
> > >
> > > чт, 3 бер. 2022 р. о 11:37 Abdelatif Guettouche
> > > <ab...@gmail.com> пише:
> > > >
> > > > > I think with NuttX 10.2.0 you do not need to perform the next
> steps any more.
> > > >
> > > > These are necessary when someone is using a custom board without a
> > > > common folder copied from a board in-tree that contains a common
> > > > folder.
> > > >
> > > > On Thu, Mar 3, 2022 at 11:31 AM Abdelatif Guettouche
> > > > <ab...@gmail.com> wrote:
> > > > >
> > > > > > "Which is forcing a common directory when there isn't one. " --
> This
> > > > > > statement is not true as we have
> > > > > >
> https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > >
> > > > > Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> > > > > tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will
> have
> > > > > a value, whether there is a common directory or not.
> > > > >
> > > > > On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> > > > > <pe...@gmail.com> wrote:
> > > > > >
> > > > > > Hello Abdelatif,
> > > > > >
> > > > > > "Which is forcing a common directory when there isn't one. " --
> This
> > > > > > statement is not true as we have
> > > > > >
> https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > > >
> > > > > > Getting back to original question:
> > > > > >
> > > > > > > To build my apps I just need to create a symbolic link called
> external
> > > > > > > inside apps folder. To create a new custom board I start
> copying a similar
> > > > > > > board (e.g nucleo-g431kb) to my-boards folder and make the
> following changes
> > > > > > >
> > > > > > > *remove from defconfig:*
> > > > > > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > >
> > > > > > > *add on defconfig:*
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > >
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > >
> > > > > > > *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > >
> > > > > > > This works well for me up to Nuttx version 10.2.0 but now when
> I try to
> > > > > > > make I got the errors
> > > > > >
> > > > > > I think with NuttX 10.2.0 you do not need to perform the next
> steps any more.
> > > > > >
> > > > > >    *Rename src/Make.defs to src/Makefile and append the line *
> > > > > >    include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > >
> > > > > > I will get back to errors met by Jukka to see what caused the
> problem
> > > > > > in his case.
> > > > > >
> > > > > > Best regards,
> > > > > > Petro
> > > > > >
> > > > > > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > > > > > <ab...@gmail.com> пише:
> > > > > > >
> > > > > > > > It seems like Daniel is hitting the same issue
> > > > > > >
> > > > > > > Daniel is actually not using the common folder from the STM32
> > > > > > > directory.  This is why he had to do that renaming.
> > > > > > > The issue is this:
> > > > > > >
> https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > > > > > Which is forcing a common directory when there isn't one. This
> should
> > > > > > > not be done as people have requested before to be able to use
> boards
> > > > > > > without a common directory even if in-tree we use the common
> > > > > > > directory.
> > > > > > > Daniel, you can just remove those lines to confirm that it
> builds fine
> > > > > > > (I tried and it does, at least you don't have that error
> anymore,
> > > > > > > there are some trivial compile errors though in the board).
> > > > > > > For a final solution I think we can either remove them
> completely or
> > > > > > > just add an else statement. I didn't have time to think about
> it.
> > > > > > >
> > > > > > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <
> jukka.laitinen@iki.fi> wrote:
> > > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Maybe I was jumping in to conclusion and the issue is not
> the same as
> > > > > > > > what I had. I was building PX4, which uses CMake build
> system, so I am
> > > > > > > > not having any Makefile or Make.defs in my own board
> directory. Also the
> > > > > > > > platform is not stm or arm, but risc-v.
> > > > > > > >
> > > > > > > > Anyhow, this is the error which I started getting in my
> build scripts:
> > > > > > > >
> > > > > > > > "
> > > > > > > >
> > > > > > > > ninja: error:
> > > > > > > >
> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make
> it
> > > > > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > > > > "
> > > > > > > >
> > > > > > > > My configs are:
> > > > > > > >
> > > > > > > > CONFIG_ARCH="risc-v"
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > > > > >
> > > > > > > > One version, where it fails is available publicly in
> > > > > > > >
> > > > > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included
> as a submodule)
> > > > > > > >
> > > > > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > > > > platforms/nuttx/Nuttx/nuttx.
> > > > > > > >
> > > > > > > > I didn't yet start looking into it in detail, what goes
> wrong, just
> > > > > > > > bisected the nuttx and reverted the commit which broke it
> for me. I need
> > > > > > > > to look back later to see how to change the off-tree board
> config to get
> > > > > > > > it back online.
> > > > > > > >
> > > > > > > > Just noticed that the error is somewhat similar, although
> coming from
> > > > > > > > different build env. But in my case it is likely that I need
> to adapt
> > > > > > > > the cmake build scripts according to the changes in nuttx.
> > > > > > > >
> > > > > > > > -Jukka
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > > > > Hello Jukka,
> > > > > > > > >
> > > > > > > > > So you experience the same problem as Daniel and reverting
> the commit helps?
> > > > > > > > >
> > > > > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was
> no way to
> > > > > > > > > reuse common code from "nuttx/board/...". I'm using a
> custom board
> > > > > > > > > based on SAME70 and after
> > > > > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I
> found my code
> > > > > > > > > tree broken. Now the folder structure for
> "boards/arm/samv7" is the
> > > > > > > > > same as in "boards/arm/stm32". Here is what I did to get
> it back
> > > > > > > > > running:
> > > > > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > > > > 2. Renamed "custom-board/src/Makefile" to
> "custom-board/src/Make.defs"
> > > > > > > > > and synced with
> "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > > > > >
> > > > > > > > > It seems like Daniel is hitting the same issue, so I
> expect that
> > > > > > > > > renaming Makefile to Make.defs plus setting
> "BOARD_STM32_COMMON=n"
> > > > > > > > > should fix the issue without any additional file clean-up.
> > > > > > > > > Please give me feedback if that helps.
> > > > > > > > >
> > > > > > > > > Best regards,
> > > > > > > > > Petro
> > > > > > > > >
> > > > > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <
> jukka.laitinen@iki.fi> пише:
> > > > > > > > >> HI,
> > > > > > > > >>
> > > > > > > > >> Not sure what is the correct way to fix this, but I
> reverted:
> > > > > > > > >>
> > > > > > > > >> "
> > > > > > > > >>
> > > > > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > > > > >>
> > > > > > > > >>       tools: add option to reuse boards common files for
> custom boards
> > > > > > > > >>
> > > > > > > > >>       Signed-off-by: Petro Karashchenko <
> petro.karashchenko@gmail.com>
> > > > > > > > >> "
> > > > > > > > >>
> > > > > > > > >> Petro, what is the proper way to configure this?
> > > > > > > > >>
> > > > > > > > >> Thanks,
> > > > > > > > >>
> > > > > > > > >> Jukka
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > > > > >>
> > > > > > > > >>> Hi guys,
> > > > > > > > >>>
> > > > > > > > >>> I am having problems building custom boards outside of
> the Nuttx folder
> > > > > > > > >>> tree. Usually I use the following folder structure.
> > > > > > > > >>>
> > > > > > > > >>> |-> apps
> > > > > > > > >>> |-> my-folder
> > > > > > > > >>>      |-> my-apps
> > > > > > > > >>>         |-> custom-app
> > > > > > > > >>>      |-> my-boards
> > > > > > > > >>>         |-> custom-board
> > > > > > > > >>> |-> nuttx
> > > > > > > > >>>
> > > > > > > > >>> To build my apps I just need to create a symbolic link
> called external
> > > > > > > > >>> inside apps folder. To create a new custom board I start
> copying a similar
> > > > > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make
> the following changes
> > > > > > > > >>>
> > > > > > > > >>> *remove from defconfig:*
> > > > > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > > > >>>
> > > > > > > > >>> *add on defconfig:*
> > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > > >>>
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > > > >>>
> > > > > > > > >>> *Rename src/Make.defs to src/Makefile and append the
> line *
> > > > > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > > >>>
> > > > > > > > >>> This works well for me up to Nuttx version 10.2.0 but
> now when I try to
> > > > > > > > >>> make I got the errors
> > > > > > > > >>>
> > > > > > > > >>> make[1]: Entering directory
> '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > >>> make[1]: Leaving directory
> '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > >>> make[1]: Entering directory
> '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > >>> make[1]: Leaving directory
> '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > > >>> Create version.h
> > > > > > > > >>> make[1]: Entering directory
> '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > >>> make[2]: Entering directory
> > > > > > > > >>>
> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.
> Stop.
> > > > > > > > >>> make[2]: Leaving directory
> > > > > > > > >>>
> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > > > > >>> make[1]: Leaving directory
> '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > > > > >>>
> > > > > > > > >>> Does anyone know how to fix this problem?
> > > > > > > > >>>
> > > > > > > > >>> Thanks
> > > > > > > > >>>
> > > > > > > > >>> Daniel Pereira de Carvalho
> > > > > > > > >>>
>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Abdelatif,

I just tried to recreate the same scenario. To do this I did:
1. Recreated folder structure as in Daniel's case
|-> apps
|-> my-folder
     |-> my-boards
       |-> custom-board
|-> nuttx

2. Copied  nucleo-g431kb to custom-board: cd my-folder/my-boards && cp
-r ../../nuttx/boards/arm/stm32/nucleo-g431kb custom-board

3. *remove from defconfig:*
CONFIG_ARCH_BOARD="nucleo-g431kb"
CONFIG_ARCH_BOARD_NUCLEO_G431KB=y

4. *add on defconfig:*
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"

5. I did not performed: "*Rename src/Make.defs to src/Makefile and
append the line include $(TOPDIR)/boards/Board.mk at the end of
file.*"

6. tools/configure.sh ../my-folder/my-boards/custom-board/configs/nsh

7. make -j8

Compilation failed, but not because of a common folder but because:
"board/stm32_userleds.c:60:14: error: 'BOARD_LED1' undeclared (first
use in this function); did you mean 'BOARD_LED2'?". So I had to "make
menuconfig" and select "BOARD_CUSTOM_LEDS" to pass compilation
successfully.

"It could be that they have an old board where the common folder
structure didn't exist at the time and they don't want to change their
structure." -- I think this is a weak argument as we change config
option names sometimes as users are forced to adapt their code. The
only miss that I see here is that the
https://github.com/apache/incubator-nuttx/pull/5274 was not marked as
a "breaking change".

Best regards,
Petro

чт, 3 бер. 2022 р. о 11:57 Abdelatif Guettouche
<ab...@gmail.com> пише:
>
> > If what you are writing is true, then compilation for any board that
> > does not have a "common" folder at board level should fail.
>
> No because in-tree this line: BOARD_COMMON_DIR = $(wildcard
> $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)common)
> will result on an empty string.
>
> > We just need to copy source files from
> > NuttX board common to custom board location and add files to
> > compilation list
>
> The thing is that some people won't want to do that.  They don't want
> to use the common folder. It could be that they have an old board
> where the common folder structure didn't exist at the time and they
> don't want to change their structure.
>
> > Or maybe I'm missing the exact use case.
>
> Daniel's use case is the following: Use a custom board copied from an
> in-tree board _without_ using the common directory even if one exists.
>
> On Thu, Mar 3, 2022 at 11:43 AM Petro Karashchenko
> <pe...@gmail.com> wrote:
> >
> > Hi,
> >
> > There is no problem with that. We just need to copy source files from
> > NuttX board common to custom board location and add files to
> > compilation list together with disabling of NuttX board common layer
> > (set CONFIG_BOARD_STM32_COMMON=n for example with STM32 case).
> >
> > Or maybe I'm missing the exact use case. If yes, then please describe
> > it more clearly and I will try to go through it to see if that can be
> > achieved with the current code tree or not.
> >
> > Best regards,
> > Petro
> >
> > чт, 3 бер. 2022 р. о 11:37 Abdelatif Guettouche
> > <ab...@gmail.com> пише:
> > >
> > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > >
> > > These are necessary when someone is using a custom board without a
> > > common folder copied from a board in-tree that contains a common
> > > folder.
> > >
> > > On Thu, Mar 3, 2022 at 11:31 AM Abdelatif Guettouche
> > > <ab...@gmail.com> wrote:
> > > >
> > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > statement is not true as we have
> > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > >
> > > > Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> > > > tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
> > > > a value, whether there is a common directory or not.
> > > >
> > > > On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> > > > <pe...@gmail.com> wrote:
> > > > >
> > > > > Hello Abdelatif,
> > > > >
> > > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > > statement is not true as we have
> > > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > > >
> > > > > Getting back to original question:
> > > > >
> > > > > > To build my apps I just need to create a symbolic link called external
> > > > > > inside apps folder. To create a new custom board I start copying a similar
> > > > > > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > >
> > > > > > *remove from defconfig:*
> > > > > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > >
> > > > > > *add on defconfig:*
> > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > >
> > > > > > *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > >
> > > > > > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > make I got the errors
> > > > >
> > > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > > >
> > > > >    *Rename src/Make.defs to src/Makefile and append the line *
> > > > >    include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > >
> > > > > I will get back to errors met by Jukka to see what caused the problem
> > > > > in his case.
> > > > >
> > > > > Best regards,
> > > > > Petro
> > > > >
> > > > > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > > > > <ab...@gmail.com> пише:
> > > > > >
> > > > > > > It seems like Daniel is hitting the same issue
> > > > > >
> > > > > > Daniel is actually not using the common folder from the STM32
> > > > > > directory.  This is why he had to do that renaming.
> > > > > > The issue is this:
> > > > > > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > > > > Which is forcing a common directory when there isn't one. This should
> > > > > > not be done as people have requested before to be able to use boards
> > > > > > without a common directory even if in-tree we use the common
> > > > > > directory.
> > > > > > Daniel, you can just remove those lines to confirm that it builds fine
> > > > > > (I tried and it does, at least you don't have that error anymore,
> > > > > > there are some trivial compile errors though in the board).
> > > > > > For a final solution I think we can either remove them completely or
> > > > > > just add an else statement. I didn't have time to think about it.
> > > > > >
> > > > > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > > > > platform is not stm or arm, but risc-v.
> > > > > > >
> > > > > > > Anyhow, this is the error which I started getting in my build scripts:
> > > > > > >
> > > > > > > "
> > > > > > >
> > > > > > > ninja: error:
> > > > > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > > > "
> > > > > > >
> > > > > > > My configs are:
> > > > > > >
> > > > > > > CONFIG_ARCH="risc-v"
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > > > >
> > > > > > > One version, where it fails is available publicly in
> > > > > > >
> > > > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > > > > >
> > > > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > > > platforms/nuttx/Nuttx/nuttx.
> > > > > > >
> > > > > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > > > > to look back later to see how to change the off-tree board config to get
> > > > > > > it back online.
> > > > > > >
> > > > > > > Just noticed that the error is somewhat similar, although coming from
> > > > > > > different build env. But in my case it is likely that I need to adapt
> > > > > > > the cmake build scripts according to the changes in nuttx.
> > > > > > >
> > > > > > > -Jukka
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > > > Hello Jukka,
> > > > > > > >
> > > > > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > > > > >
> > > > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > > > > based on SAME70 and after
> > > > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > > > > running:
> > > > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > > > >
> > > > > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > > > > should fix the issue without any additional file clean-up.
> > > > > > > > Please give me feedback if that helps.
> > > > > > > >
> > > > > > > > Best regards,
> > > > > > > > Petro
> > > > > > > >
> > > > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > > > >> HI,
> > > > > > > >>
> > > > > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > > > > >>
> > > > > > > >> "
> > > > > > > >>
> > > > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > > > >>
> > > > > > > >>       tools: add option to reuse boards common files for custom boards
> > > > > > > >>
> > > > > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > > > > >> "
> > > > > > > >>
> > > > > > > >> Petro, what is the proper way to configure this?
> > > > > > > >>
> > > > > > > >> Thanks,
> > > > > > > >>
> > > > > > > >> Jukka
> > > > > > > >>
> > > > > > > >>
> > > > > > > >>
> > > > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > > > >>
> > > > > > > >>> Hi guys,
> > > > > > > >>>
> > > > > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > > > > >>> tree. Usually I use the following folder structure.
> > > > > > > >>>
> > > > > > > >>> |-> apps
> > > > > > > >>> |-> my-folder
> > > > > > > >>>      |-> my-apps
> > > > > > > >>>         |-> custom-app
> > > > > > > >>>      |-> my-boards
> > > > > > > >>>         |-> custom-board
> > > > > > > >>> |-> nuttx
> > > > > > > >>>
> > > > > > > >>> To build my apps I just need to create a symbolic link called external
> > > > > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > > >>>
> > > > > > > >>> *remove from defconfig:*
> > > > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > > >>>
> > > > > > > >>> *add on defconfig:*
> > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > > >>>
> > > > > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > > >>>
> > > > > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > > >>> make I got the errors
> > > > > > > >>>
> > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > > >>> Create version.h
> > > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > >>> make[2]: Entering directory
> > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > > > > >>> make[2]: Leaving directory
> > > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > > > >>>
> > > > > > > >>> Does anyone know how to fix this problem?
> > > > > > > >>>
> > > > > > > >>> Thanks
> > > > > > > >>>
> > > > > > > >>> Daniel Pereira de Carvalho
> > > > > > > >>>

Re: Error when building custom board

Posted by Abdelatif Guettouche <ab...@gmail.com>.
> If what you are writing is true, then compilation for any board that
> does not have a "common" folder at board level should fail.

No because in-tree this line: BOARD_COMMON_DIR = $(wildcard
$(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)common)
will result on an empty string.

> We just need to copy source files from
> NuttX board common to custom board location and add files to
> compilation list

The thing is that some people won't want to do that.  They don't want
to use the common folder. It could be that they have an old board
where the common folder structure didn't exist at the time and they
don't want to change their structure.

> Or maybe I'm missing the exact use case.

Daniel's use case is the following: Use a custom board copied from an
in-tree board _without_ using the common directory even if one exists.

On Thu, Mar 3, 2022 at 11:43 AM Petro Karashchenko
<pe...@gmail.com> wrote:
>
> Hi,
>
> There is no problem with that. We just need to copy source files from
> NuttX board common to custom board location and add files to
> compilation list together with disabling of NuttX board common layer
> (set CONFIG_BOARD_STM32_COMMON=n for example with STM32 case).
>
> Or maybe I'm missing the exact use case. If yes, then please describe
> it more clearly and I will try to go through it to see if that can be
> achieved with the current code tree or not.
>
> Best regards,
> Petro
>
> чт, 3 бер. 2022 р. о 11:37 Abdelatif Guettouche
> <ab...@gmail.com> пише:
> >
> > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> >
> > These are necessary when someone is using a custom board without a
> > common folder copied from a board in-tree that contains a common
> > folder.
> >
> > On Thu, Mar 3, 2022 at 11:31 AM Abdelatif Guettouche
> > <ab...@gmail.com> wrote:
> > >
> > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > statement is not true as we have
> > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > >
> > > Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> > > tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
> > > a value, whether there is a common directory or not.
> > >
> > > On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> > > <pe...@gmail.com> wrote:
> > > >
> > > > Hello Abdelatif,
> > > >
> > > > "Which is forcing a common directory when there isn't one. " -- This
> > > > statement is not true as we have
> > > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > > >
> > > > Getting back to original question:
> > > >
> > > > > To build my apps I just need to create a symbolic link called external
> > > > > inside apps folder. To create a new custom board I start copying a similar
> > > > > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > >
> > > > > *remove from defconfig:*
> > > > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > >
> > > > > *add on defconfig:*
> > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > >
> > > > > *Rename src/Make.defs to src/Makefile and append the line *
> > > > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > >
> > > > > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > make I got the errors
> > > >
> > > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > > >
> > > >    *Rename src/Make.defs to src/Makefile and append the line *
> > > >    include $(TOPDIR)/boards/Board.mk at the end of file.
> > > >
> > > > I will get back to errors met by Jukka to see what caused the problem
> > > > in his case.
> > > >
> > > > Best regards,
> > > > Petro
> > > >
> > > > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > > > <ab...@gmail.com> пише:
> > > > >
> > > > > > It seems like Daniel is hitting the same issue
> > > > >
> > > > > Daniel is actually not using the common folder from the STM32
> > > > > directory.  This is why he had to do that renaming.
> > > > > The issue is this:
> > > > > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > > > Which is forcing a common directory when there isn't one. This should
> > > > > not be done as people have requested before to be able to use boards
> > > > > without a common directory even if in-tree we use the common
> > > > > directory.
> > > > > Daniel, you can just remove those lines to confirm that it builds fine
> > > > > (I tried and it does, at least you don't have that error anymore,
> > > > > there are some trivial compile errors though in the board).
> > > > > For a final solution I think we can either remove them completely or
> > > > > just add an else statement. I didn't have time to think about it.
> > > > >
> > > > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > > > platform is not stm or arm, but risc-v.
> > > > > >
> > > > > > Anyhow, this is the error which I started getting in my build scripts:
> > > > > >
> > > > > > "
> > > > > >
> > > > > > ninja: error:
> > > > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > > "
> > > > > >
> > > > > > My configs are:
> > > > > >
> > > > > > CONFIG_ARCH="risc-v"
> > > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > > >
> > > > > > One version, where it fails is available publicly in
> > > > > >
> > > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > > > >
> > > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > > platforms/nuttx/Nuttx/nuttx.
> > > > > >
> > > > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > > > to look back later to see how to change the off-tree board config to get
> > > > > > it back online.
> > > > > >
> > > > > > Just noticed that the error is somewhat similar, although coming from
> > > > > > different build env. But in my case it is likely that I need to adapt
> > > > > > the cmake build scripts according to the changes in nuttx.
> > > > > >
> > > > > > -Jukka
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > > Hello Jukka,
> > > > > > >
> > > > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > > > >
> > > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > > > based on SAME70 and after
> > > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > > > running:
> > > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > > >
> > > > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > > > should fix the issue without any additional file clean-up.
> > > > > > > Please give me feedback if that helps.
> > > > > > >
> > > > > > > Best regards,
> > > > > > > Petro
> > > > > > >
> > > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > > >> HI,
> > > > > > >>
> > > > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > > > >>
> > > > > > >> "
> > > > > > >>
> > > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > > >>
> > > > > > >>       tools: add option to reuse boards common files for custom boards
> > > > > > >>
> > > > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > > > >> "
> > > > > > >>
> > > > > > >> Petro, what is the proper way to configure this?
> > > > > > >>
> > > > > > >> Thanks,
> > > > > > >>
> > > > > > >> Jukka
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > > >>
> > > > > > >>> Hi guys,
> > > > > > >>>
> > > > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > > > >>> tree. Usually I use the following folder structure.
> > > > > > >>>
> > > > > > >>> |-> apps
> > > > > > >>> |-> my-folder
> > > > > > >>>      |-> my-apps
> > > > > > >>>         |-> custom-app
> > > > > > >>>      |-> my-boards
> > > > > > >>>         |-> custom-board
> > > > > > >>> |-> nuttx
> > > > > > >>>
> > > > > > >>> To build my apps I just need to create a symbolic link called external
> > > > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > > >>>
> > > > > > >>> *remove from defconfig:*
> > > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > > >>>
> > > > > > >>> *add on defconfig:*
> > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > > >>>
> > > > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > > >>>
> > > > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > > >>> make I got the errors
> > > > > > >>>
> > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > > >>> Create version.h
> > > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > >>> make[2]: Entering directory
> > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > > > >>> make[2]: Leaving directory
> > > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > > >>>
> > > > > > >>> Does anyone know how to fix this problem?
> > > > > > >>>
> > > > > > >>> Thanks
> > > > > > >>>
> > > > > > >>> Daniel Pereira de Carvalho
> > > > > > >>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hi,

There is no problem with that. We just need to copy source files from
NuttX board common to custom board location and add files to
compilation list together with disabling of NuttX board common layer
(set CONFIG_BOARD_STM32_COMMON=n for example with STM32 case).

Or maybe I'm missing the exact use case. If yes, then please describe
it more clearly and I will try to go through it to see if that can be
achieved with the current code tree or not.

Best regards,
Petro

чт, 3 бер. 2022 р. о 11:37 Abdelatif Guettouche
<ab...@gmail.com> пише:
>
> > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
>
> These are necessary when someone is using a custom board without a
> common folder copied from a board in-tree that contains a common
> folder.
>
> On Thu, Mar 3, 2022 at 11:31 AM Abdelatif Guettouche
> <ab...@gmail.com> wrote:
> >
> > > "Which is forcing a common directory when there isn't one. " -- This
> > > statement is not true as we have
> > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > that depends on if "BOARD_COMMON_DIR" exists or not.
> >
> > Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> > tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
> > a value, whether there is a common directory or not.
> >
> > On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> > <pe...@gmail.com> wrote:
> > >
> > > Hello Abdelatif,
> > >
> > > "Which is forcing a common directory when there isn't one. " -- This
> > > statement is not true as we have
> > > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > > that depends on if "BOARD_COMMON_DIR" exists or not.
> > >
> > > Getting back to original question:
> > >
> > > > To build my apps I just need to create a symbolic link called external
> > > > inside apps folder. To create a new custom board I start copying a similar
> > > > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > >
> > > > *remove from defconfig:*
> > > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > >
> > > > *add on defconfig:*
> > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > >
> > > > *Rename src/Make.defs to src/Makefile and append the line *
> > > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > > >
> > > > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > make I got the errors
> > >
> > > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> > >
> > >    *Rename src/Make.defs to src/Makefile and append the line *
> > >    include $(TOPDIR)/boards/Board.mk at the end of file.
> > >
> > > I will get back to errors met by Jukka to see what caused the problem
> > > in his case.
> > >
> > > Best regards,
> > > Petro
> > >
> > > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > > <ab...@gmail.com> пише:
> > > >
> > > > > It seems like Daniel is hitting the same issue
> > > >
> > > > Daniel is actually not using the common folder from the STM32
> > > > directory.  This is why he had to do that renaming.
> > > > The issue is this:
> > > > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > > Which is forcing a common directory when there isn't one. This should
> > > > not be done as people have requested before to be able to use boards
> > > > without a common directory even if in-tree we use the common
> > > > directory.
> > > > Daniel, you can just remove those lines to confirm that it builds fine
> > > > (I tried and it does, at least you don't have that error anymore,
> > > > there are some trivial compile errors though in the board).
> > > > For a final solution I think we can either remove them completely or
> > > > just add an else statement. I didn't have time to think about it.
> > > >
> > > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > > platform is not stm or arm, but risc-v.
> > > > >
> > > > > Anyhow, this is the error which I started getting in my build scripts:
> > > > >
> > > > > "
> > > > >
> > > > > ninja: error:
> > > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > > "
> > > > >
> > > > > My configs are:
> > > > >
> > > > > CONFIG_ARCH="risc-v"
> > > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > > >
> > > > > One version, where it fails is available publicly in
> > > > >
> > > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > > >
> > > > > Building "make ssrc_icicle_default". The board files are in
> > > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > > platforms/nuttx/Nuttx/nuttx.
> > > > >
> > > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > > to look back later to see how to change the off-tree board config to get
> > > > > it back online.
> > > > >
> > > > > Just noticed that the error is somewhat similar, although coming from
> > > > > different build env. But in my case it is likely that I need to adapt
> > > > > the cmake build scripts according to the changes in nuttx.
> > > > >
> > > > > -Jukka
> > > > >
> > > > >
> > > > >
> > > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > > Hello Jukka,
> > > > > >
> > > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > > >
> > > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > > based on SAME70 and after
> > > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > > running:
> > > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > > 3. Removed files in my code tree that have exactly the same
> > > > > > implementation as files from "boards/arm/samv7/common"
> > > > > >
> > > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > > should fix the issue without any additional file clean-up.
> > > > > > Please give me feedback if that helps.
> > > > > >
> > > > > > Best regards,
> > > > > > Petro
> > > > > >
> > > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > > >> HI,
> > > > > >>
> > > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > > >>
> > > > > >> "
> > > > > >>
> > > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > > >>
> > > > > >>       tools: add option to reuse boards common files for custom boards
> > > > > >>
> > > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > > >> "
> > > > > >>
> > > > > >> Petro, what is the proper way to configure this?
> > > > > >>
> > > > > >> Thanks,
> > > > > >>
> > > > > >> Jukka
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > > >>
> > > > > >>> Hi guys,
> > > > > >>>
> > > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > > >>> tree. Usually I use the following folder structure.
> > > > > >>>
> > > > > >>> |-> apps
> > > > > >>> |-> my-folder
> > > > > >>>      |-> my-apps
> > > > > >>>         |-> custom-app
> > > > > >>>      |-> my-boards
> > > > > >>>         |-> custom-board
> > > > > >>> |-> nuttx
> > > > > >>>
> > > > > >>> To build my apps I just need to create a symbolic link called external
> > > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > > >>>
> > > > > >>> *remove from defconfig:*
> > > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > > >>>
> > > > > >>> *add on defconfig:*
> > > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > > >>>
> > > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > > >>>
> > > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > > >>> make I got the errors
> > > > > >>>
> > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > > >>> Create version.h
> > > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > >>> make[2]: Entering directory
> > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > > >>> make[2]: Leaving directory
> > > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > > >>>
> > > > > >>> Does anyone know how to fix this problem?
> > > > > >>>
> > > > > >>> Thanks
> > > > > >>>
> > > > > >>> Daniel Pereira de Carvalho
> > > > > >>>

Re: Error when building custom board

Posted by Abdelatif Guettouche <ab...@gmail.com>.
> I think with NuttX 10.2.0 you do not need to perform the next steps any more.

These are necessary when someone is using a custom board without a
common folder copied from a board in-tree that contains a common
folder.

On Thu, Mar 3, 2022 at 11:31 AM Abdelatif Guettouche
<ab...@gmail.com> wrote:
>
> > "Which is forcing a common directory when there isn't one. " -- This
> > statement is not true as we have
> > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > that depends on if "BOARD_COMMON_DIR" exists or not.
>
> Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
> tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
> a value, whether there is a common directory or not.
>
> On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
> <pe...@gmail.com> wrote:
> >
> > Hello Abdelatif,
> >
> > "Which is forcing a common directory when there isn't one. " -- This
> > statement is not true as we have
> > https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> > that depends on if "BOARD_COMMON_DIR" exists or not.
> >
> > Getting back to original question:
> >
> > > To build my apps I just need to create a symbolic link called external
> > > inside apps folder. To create a new custom board I start copying a similar
> > > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > >
> > > *remove from defconfig:*
> > > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > >
> > > *add on defconfig:*
> > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > >
> > > *Rename src/Make.defs to src/Makefile and append the line *
> > > include $(TOPDIR)/boards/Board.mk at the end of file.
> > >
> > > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > make I got the errors
> >
> > I think with NuttX 10.2.0 you do not need to perform the next steps any more.
> >
> >    *Rename src/Make.defs to src/Makefile and append the line *
> >    include $(TOPDIR)/boards/Board.mk at the end of file.
> >
> > I will get back to errors met by Jukka to see what caused the problem
> > in his case.
> >
> > Best regards,
> > Petro
> >
> > чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> > <ab...@gmail.com> пише:
> > >
> > > > It seems like Daniel is hitting the same issue
> > >
> > > Daniel is actually not using the common folder from the STM32
> > > directory.  This is why he had to do that renaming.
> > > The issue is this:
> > > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > > Which is forcing a common directory when there isn't one. This should
> > > not be done as people have requested before to be able to use boards
> > > without a common directory even if in-tree we use the common
> > > directory.
> > > Daniel, you can just remove those lines to confirm that it builds fine
> > > (I tried and it does, at least you don't have that error anymore,
> > > there are some trivial compile errors though in the board).
> > > For a final solution I think we can either remove them completely or
> > > just add an else statement. I didn't have time to think about it.
> > >
> > > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > > >
> > > > Hi,
> > > >
> > > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > > what I had. I was building PX4, which uses CMake build system, so I am
> > > > not having any Makefile or Make.defs in my own board directory. Also the
> > > > platform is not stm or arm, but risc-v.
> > > >
> > > > Anyhow, this is the error which I started getting in my build scripts:
> > > >
> > > > "
> > > >
> > > > ninja: error:
> > > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > > "
> > > >
> > > > My configs are:
> > > >
> > > > CONFIG_ARCH="risc-v"
> > > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > > >
> > > > One version, where it fails is available publicly in
> > > >
> > > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > > >
> > > > Building "make ssrc_icicle_default". The board files are in
> > > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > > platforms/nuttx/Nuttx/nuttx.
> > > >
> > > > I didn't yet start looking into it in detail, what goes wrong, just
> > > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > > to look back later to see how to change the off-tree board config to get
> > > > it back online.
> > > >
> > > > Just noticed that the error is somewhat similar, although coming from
> > > > different build env. But in my case it is likely that I need to adapt
> > > > the cmake build scripts according to the changes in nuttx.
> > > >
> > > > -Jukka
> > > >
> > > >
> > > >
> > > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > > Hello Jukka,
> > > > >
> > > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > > >
> > > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > > based on SAME70 and after
> > > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > > running:
> > > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > > 3. Removed files in my code tree that have exactly the same
> > > > > implementation as files from "boards/arm/samv7/common"
> > > > >
> > > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > > should fix the issue without any additional file clean-up.
> > > > > Please give me feedback if that helps.
> > > > >
> > > > > Best regards,
> > > > > Petro
> > > > >
> > > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > > >> HI,
> > > > >>
> > > > >> Not sure what is the correct way to fix this, but I reverted:
> > > > >>
> > > > >> "
> > > > >>
> > > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > > >>
> > > > >>       tools: add option to reuse boards common files for custom boards
> > > > >>
> > > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > > >> "
> > > > >>
> > > > >> Petro, what is the proper way to configure this?
> > > > >>
> > > > >> Thanks,
> > > > >>
> > > > >> Jukka
> > > > >>
> > > > >>
> > > > >>
> > > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > > >>
> > > > >>> Hi guys,
> > > > >>>
> > > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > > >>> tree. Usually I use the following folder structure.
> > > > >>>
> > > > >>> |-> apps
> > > > >>> |-> my-folder
> > > > >>>      |-> my-apps
> > > > >>>         |-> custom-app
> > > > >>>      |-> my-boards
> > > > >>>         |-> custom-board
> > > > >>> |-> nuttx
> > > > >>>
> > > > >>> To build my apps I just need to create a symbolic link called external
> > > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > > >>>
> > > > >>> *remove from defconfig:*
> > > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > > >>>
> > > > >>> *add on defconfig:*
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > > >>>
> > > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > > >>>
> > > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > > >>> make I got the errors
> > > > >>>
> > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > > >>> Create version.h
> > > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > >>> make[2]: Entering directory
> > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > > >>> make[2]: Leaving directory
> > > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > > >>>
> > > > >>> Does anyone know how to fix this problem?
> > > > >>>
> > > > >>> Thanks
> > > > >>>
> > > > >>> Daniel Pereira de Carvalho
> > > > >>>

Re: Error when building custom board

Posted by Abdelatif Guettouche <ab...@gmail.com>.
> "Which is forcing a common directory when there isn't one. " -- This
> statement is not true as we have
> https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> that depends on if "BOARD_COMMON_DIR" exists or not.

Unix.mk includes $(TOPDIR)/Make.defs which in its turn includes
tools/Config.mk so reaching that Make rule, BOARD_COMMON_DIR will have
a value, whether there is a common directory or not.

On Thu, Mar 3, 2022 at 11:09 AM Petro Karashchenko
<pe...@gmail.com> wrote:
>
> Hello Abdelatif,
>
> "Which is forcing a common directory when there isn't one. " -- This
> statement is not true as we have
> https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
> that depends on if "BOARD_COMMON_DIR" exists or not.
>
> Getting back to original question:
>
> > To build my apps I just need to create a symbolic link called external
> > inside apps folder. To create a new custom board I start copying a similar
> > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> >
> > *remove from defconfig:*
> > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> >
> > *add on defconfig:*
> > CONFIG_ARCH_BOARD_CUSTOM=y
> > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> >
> > *Rename src/Make.defs to src/Makefile and append the line *
> > include $(TOPDIR)/boards/Board.mk at the end of file.
> >
> > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > make I got the errors
>
> I think with NuttX 10.2.0 you do not need to perform the next steps any more.
>
>    *Rename src/Make.defs to src/Makefile and append the line *
>    include $(TOPDIR)/boards/Board.mk at the end of file.
>
> I will get back to errors met by Jukka to see what caused the problem
> in his case.
>
> Best regards,
> Petro
>
> чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
> <ab...@gmail.com> пише:
> >
> > > It seems like Daniel is hitting the same issue
> >
> > Daniel is actually not using the common folder from the STM32
> > directory.  This is why he had to do that renaming.
> > The issue is this:
> > https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> > Which is forcing a common directory when there isn't one. This should
> > not be done as people have requested before to be able to use boards
> > without a common directory even if in-tree we use the common
> > directory.
> > Daniel, you can just remove those lines to confirm that it builds fine
> > (I tried and it does, at least you don't have that error anymore,
> > there are some trivial compile errors though in the board).
> > For a final solution I think we can either remove them completely or
> > just add an else statement. I didn't have time to think about it.
> >
> > On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> > >
> > > Hi,
> > >
> > > Maybe I was jumping in to conclusion and the issue is not the same as
> > > what I had. I was building PX4, which uses CMake build system, so I am
> > > not having any Makefile or Make.defs in my own board directory. Also the
> > > platform is not stm or arm, but risc-v.
> > >
> > > Anyhow, this is the error which I started getting in my build scripts:
> > >
> > > "
> > >
> > > ninja: error:
> > > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > > "
> > >
> > > My configs are:
> > >
> > > CONFIG_ARCH="risc-v"
> > > CONFIG_ARCH_BOARD_CUSTOM=y
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> > >
> > > One version, where it fails is available publicly in
> > >
> > > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> > >
> > > Building "make ssrc_icicle_default". The board files are in
> > > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > > platforms/nuttx/Nuttx/nuttx.
> > >
> > > I didn't yet start looking into it in detail, what goes wrong, just
> > > bisected the nuttx and reverted the commit which broke it for me. I need
> > > to look back later to see how to change the off-tree board config to get
> > > it back online.
> > >
> > > Just noticed that the error is somewhat similar, although coming from
> > > different build env. But in my case it is likely that I need to adapt
> > > the cmake build scripts according to the changes in nuttx.
> > >
> > > -Jukka
> > >
> > >
> > >
> > > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > > Hello Jukka,
> > > >
> > > > So you experience the same problem as Daniel and reverting the commit helps?
> > > >
> > > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > > based on SAME70 and after
> > > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > > running:
> > > > 1. Synced "custom-board/scripts/Make.defs" with
> > > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > > 3. Removed files in my code tree that have exactly the same
> > > > implementation as files from "boards/arm/samv7/common"
> > > >
> > > > It seems like Daniel is hitting the same issue, so I expect that
> > > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > > should fix the issue without any additional file clean-up.
> > > > Please give me feedback if that helps.
> > > >
> > > > Best regards,
> > > > Petro
> > > >
> > > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > > >> HI,
> > > >>
> > > >> Not sure what is the correct way to fix this, but I reverted:
> > > >>
> > > >> "
> > > >>
> > > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > > >> Author: Petro Karashchenko <pe...@gmail.com>
> > > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > > >>
> > > >>       tools: add option to reuse boards common files for custom boards
> > > >>
> > > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > > >> "
> > > >>
> > > >> Petro, what is the proper way to configure this?
> > > >>
> > > >> Thanks,
> > > >>
> > > >> Jukka
> > > >>
> > > >>
> > > >>
> > > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > > >>
> > > >>> Hi guys,
> > > >>>
> > > >>> I am having problems building custom boards outside of the Nuttx folder
> > > >>> tree. Usually I use the following folder structure.
> > > >>>
> > > >>> |-> apps
> > > >>> |-> my-folder
> > > >>>      |-> my-apps
> > > >>>         |-> custom-app
> > > >>>      |-> my-boards
> > > >>>         |-> custom-board
> > > >>> |-> nuttx
> > > >>>
> > > >>> To build my apps I just need to create a symbolic link called external
> > > >>> inside apps folder. To create a new custom board I start copying a similar
> > > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > > >>>
> > > >>> *remove from defconfig:*
> > > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > > >>>
> > > >>> *add on defconfig:*
> > > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > > >>>
> > > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > > >>>
> > > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > > >>> make I got the errors
> > > >>>
> > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > > >>> Create version.h
> > > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > >>> make[2]: Entering directory
> > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > >>> Makefile:23: board/Make.defs: No such file or directory
> > > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > > >>> make[2]: Leaving directory
> > > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > > >>> make[1]: *** [Makefile:79: context] Error 2
> > > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > > >>>
> > > >>> Does anyone know how to fix this problem?
> > > >>>
> > > >>> Thanks
> > > >>>
> > > >>> Daniel Pereira de Carvalho
> > > >>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Abdelatif,

"Which is forcing a common directory when there isn't one. " -- This
statement is not true as we have
https://github.com/apache/incubator-nuttx/blob/b953296de73ac75bb380a609f9f30e9fe34e7622/tools/Unix.mk#L272-L277
that depends on if "BOARD_COMMON_DIR" exists or not.

Getting back to original question:

> To build my apps I just need to create a symbolic link called external
> inside apps folder. To create a new custom board I start copying a similar
> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
>
> *remove from defconfig:*
> CONFIG_ARCH_BOARD="nucleo-g431kb"
> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
>
> *add on defconfig:*
> CONFIG_ARCH_BOARD_CUSTOM=y
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
>
> *Rename src/Make.defs to src/Makefile and append the line *
> include $(TOPDIR)/boards/Board.mk at the end of file.
>
> This works well for me up to Nuttx version 10.2.0 but now when I try to
> make I got the errors

I think with NuttX 10.2.0 you do not need to perform the next steps any more.

   *Rename src/Make.defs to src/Makefile and append the line *
   include $(TOPDIR)/boards/Board.mk at the end of file.

I will get back to errors met by Jukka to see what caused the problem
in his case.

Best regards,
Petro

чт, 3 бер. 2022 р. о 10:12 Abdelatif Guettouche
<ab...@gmail.com> пише:
>
> > It seems like Daniel is hitting the same issue
>
> Daniel is actually not using the common folder from the STM32
> directory.  This is why he had to do that renaming.
> The issue is this:
> https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
> Which is forcing a common directory when there isn't one. This should
> not be done as people have requested before to be able to use boards
> without a common directory even if in-tree we use the common
> directory.
> Daniel, you can just remove those lines to confirm that it builds fine
> (I tried and it does, at least you don't have that error anymore,
> there are some trivial compile errors though in the board).
> For a final solution I think we can either remove them completely or
> just add an else statement. I didn't have time to think about it.
>
> On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
> >
> > Hi,
> >
> > Maybe I was jumping in to conclusion and the issue is not the same as
> > what I had. I was building PX4, which uses CMake build system, so I am
> > not having any Makefile or Make.defs in my own board directory. Also the
> > platform is not stm or arm, but risc-v.
> >
> > Anyhow, this is the error which I started getting in my build scripts:
> >
> > "
> >
> > ninja: error:
> > '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> > 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> > make: *** [Makefile:225: ssrc_icicle_default] Error 1
> > "
> >
> > My configs are:
> >
> > CONFIG_ARCH="risc-v"
> > CONFIG_ARCH_BOARD_CUSTOM=y
> > CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
> >
> > One version, where it fails is available publicly in
> >
> > https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
> >
> > Building "make ssrc_icicle_default". The board files are in
> > boards/ssrc/icicle/nuttx-config and NuttX cloned in
> > platforms/nuttx/Nuttx/nuttx.
> >
> > I didn't yet start looking into it in detail, what goes wrong, just
> > bisected the nuttx and reverted the commit which broke it for me. I need
> > to look back later to see how to change the off-tree board config to get
> > it back online.
> >
> > Just noticed that the error is somewhat similar, although coming from
> > different build env. But in my case it is likely that I need to adapt
> > the cmake build scripts according to the changes in nuttx.
> >
> > -Jukka
> >
> >
> >
> > On 3.3.2022 9.37, Petro Karashchenko wrote:
> > > Hello Jukka,
> > >
> > > So you experience the same problem as Daniel and reverting the commit helps?
> > >
> > > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > > reuse common code from "nuttx/board/...". I'm using a custom board
> > > based on SAME70 and after
> > > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > > same as in "boards/arm/stm32". Here is what I did to get it back
> > > running:
> > > 1. Synced "custom-board/scripts/Make.defs" with
> > > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > > 3. Removed files in my code tree that have exactly the same
> > > implementation as files from "boards/arm/samv7/common"
> > >
> > > It seems like Daniel is hitting the same issue, so I expect that
> > > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > > should fix the issue without any additional file clean-up.
> > > Please give me feedback if that helps.
> > >
> > > Best regards,
> > > Petro
> > >
> > > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> > >> HI,
> > >>
> > >> Not sure what is the correct way to fix this, but I reverted:
> > >>
> > >> "
> > >>
> > >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> > >> Author: Petro Karashchenko <pe...@gmail.com>
> > >> Date:   Wed Jan 19 11:16:11 2022 +0200
> > >>
> > >>       tools: add option to reuse boards common files for custom boards
> > >>
> > >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> > >> "
> > >>
> > >> Petro, what is the proper way to configure this?
> > >>
> > >> Thanks,
> > >>
> > >> Jukka
> > >>
> > >>
> > >>
> > >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> > >>
> > >>> Hi guys,
> > >>>
> > >>> I am having problems building custom boards outside of the Nuttx folder
> > >>> tree. Usually I use the following folder structure.
> > >>>
> > >>> |-> apps
> > >>> |-> my-folder
> > >>>      |-> my-apps
> > >>>         |-> custom-app
> > >>>      |-> my-boards
> > >>>         |-> custom-board
> > >>> |-> nuttx
> > >>>
> > >>> To build my apps I just need to create a symbolic link called external
> > >>> inside apps folder. To create a new custom board I start copying a similar
> > >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> > >>>
> > >>> *remove from defconfig:*
> > >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> > >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> > >>>
> > >>> *add on defconfig:*
> > >>> CONFIG_ARCH_BOARD_CUSTOM=y
> > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> > >>>
> > >>> *Rename src/Make.defs to src/Makefile and append the line *
> > >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> > >>>
> > >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> > >>> make I got the errors
> > >>>
> > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > >>> Create version.h
> > >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > >>> make[2]: Entering directory
> > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > >>> Makefile:23: board/Make.defs: No such file or directory
> > >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > >>> make[2]: Leaving directory
> > >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > >>> make[1]: *** [Makefile:79: context] Error 2
> > >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> > >>>
> > >>> Does anyone know how to fix this problem?
> > >>>
> > >>> Thanks
> > >>>
> > >>> Daniel Pereira de Carvalho
> > >>>

Re: Error when building custom board

Posted by Abdelatif Guettouche <ab...@gmail.com>.
> It seems like Daniel is hitting the same issue

Daniel is actually not using the common folder from the STM32
directory.  This is why he had to do that renaming.
The issue is this:
https://github.com/apache/incubator-nuttx/blob/master/tools/Config.mk#L154-L156
Which is forcing a common directory when there isn't one. This should
not be done as people have requested before to be able to use boards
without a common directory even if in-tree we use the common
directory.
Daniel, you can just remove those lines to confirm that it builds fine
(I tried and it does, at least you don't have that error anymore,
there are some trivial compile errors though in the board).
For a final solution I think we can either remove them completely or
just add an else statement. I didn't have time to think about it.

On Thu, Mar 3, 2022 at 9:34 AM Jukka Laitinen <ju...@iki.fi> wrote:
>
> Hi,
>
> Maybe I was jumping in to conclusion and the issue is not the same as
> what I had. I was building PX4, which uses CMake build system, so I am
> not having any Makefile or Make.defs in my own board directory. Also the
> platform is not stm or arm, but risc-v.
>
> Anyhow, this is the error which I started getting in my build scripts:
>
> "
>
> ninja: error:
> '../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by
> 'NuttX/nuttx_copy.stamp', missing and no known rule to make it
> make: *** [Makefile:225: ssrc_icicle_default] Error 1
> "
>
> My configs are:
>
> CONFIG_ARCH="risc-v"
> CONFIG_ARCH_BOARD_CUSTOM=y
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
>
> One version, where it fails is available publicly in
>
> https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)
>
> Building "make ssrc_icicle_default". The board files are in
> boards/ssrc/icicle/nuttx-config and NuttX cloned in
> platforms/nuttx/Nuttx/nuttx.
>
> I didn't yet start looking into it in detail, what goes wrong, just
> bisected the nuttx and reverted the commit which broke it for me. I need
> to look back later to see how to change the off-tree board config to get
> it back online.
>
> Just noticed that the error is somewhat similar, although coming from
> different build env. But in my case it is likely that I need to adapt
> the cmake build scripts according to the changes in nuttx.
>
> -Jukka
>
>
>
> On 3.3.2022 9.37, Petro Karashchenko wrote:
> > Hello Jukka,
> >
> > So you experience the same problem as Daniel and reverting the commit helps?
> >
> > Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> > reuse common code from "nuttx/board/...". I'm using a custom board
> > based on SAME70 and after
> > https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> > tree broken. Now the folder structure for "boards/arm/samv7" is the
> > same as in "boards/arm/stm32". Here is what I did to get it back
> > running:
> > 1. Synced "custom-board/scripts/Make.defs" with
> > "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> > 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> > and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> > 3. Removed files in my code tree that have exactly the same
> > implementation as files from "boards/arm/samv7/common"
> >
> > It seems like Daniel is hitting the same issue, so I expect that
> > renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> > should fix the issue without any additional file clean-up.
> > Please give me feedback if that helps.
> >
> > Best regards,
> > Petro
> >
> > чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
> >> HI,
> >>
> >> Not sure what is the correct way to fix this, but I reverted:
> >>
> >> "
> >>
> >> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> >> Author: Petro Karashchenko <pe...@gmail.com>
> >> Date:   Wed Jan 19 11:16:11 2022 +0200
> >>
> >>       tools: add option to reuse boards common files for custom boards
> >>
> >>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> >> "
> >>
> >> Petro, what is the proper way to configure this?
> >>
> >> Thanks,
> >>
> >> Jukka
> >>
> >>
> >>
> >> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
> >>
> >>> Hi guys,
> >>>
> >>> I am having problems building custom boards outside of the Nuttx folder
> >>> tree. Usually I use the following folder structure.
> >>>
> >>> |-> apps
> >>> |-> my-folder
> >>>      |-> my-apps
> >>>         |-> custom-app
> >>>      |-> my-boards
> >>>         |-> custom-board
> >>> |-> nuttx
> >>>
> >>> To build my apps I just need to create a symbolic link called external
> >>> inside apps folder. To create a new custom board I start copying a similar
> >>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> >>>
> >>> *remove from defconfig:*
> >>> CONFIG_ARCH_BOARD="nucleo-g431kb"
> >>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> >>>
> >>> *add on defconfig:*
> >>> CONFIG_ARCH_BOARD_CUSTOM=y
> >>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> >>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> >>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> >>>
> >>> *Rename src/Make.defs to src/Makefile and append the line *
> >>> include $(TOPDIR)/boards/Board.mk at the end of file.
> >>>
> >>> This works well for me up to Nuttx version 10.2.0 but now when I try to
> >>> make I got the errors
> >>>
> >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> >>> Create version.h
> >>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> >>> make[2]: Entering directory
> >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>> Makefile:23: board/Make.defs: No such file or directory
> >>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> >>> make[2]: Leaving directory
> >>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> >>> make[1]: *** [Makefile:79: context] Error 2
> >>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> >>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
> >>>
> >>> Does anyone know how to fix this problem?
> >>>
> >>> Thanks
> >>>
> >>> Daniel Pereira de Carvalho
> >>>

Re: Error when building custom board

Posted by Jukka Laitinen <ju...@iki.fi>.
Hi,

Maybe I was jumping in to conclusion and the issue is not the same as 
what I had. I was building PX4, which uses CMake build system, so I am 
not having any Makefile or Make.defs in my own board directory. Also the 
platform is not stm or arm, but risc-v.

Anyhow, this is the error which I started getting in my build scripts:

"

ninja: error: 
'../../platforms/nuttx/NuttX/nuttx/arch/risc-v/include/board', needed by 
'NuttX/nuttx_copy.stamp', missing and no known rule to make it
make: *** [Makefile:225: ssrc_icicle_default] Error 1
"

My configs are:

CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"

One version, where it fails is available publicly in

https://github.com/tiiuae/px4-firmware/ (nuttx is included as a submodule)

Building "make ssrc_icicle_default". The board files are in 
boards/ssrc/icicle/nuttx-config and NuttX cloned in 
platforms/nuttx/Nuttx/nuttx.

I didn't yet start looking into it in detail, what goes wrong, just 
bisected the nuttx and reverted the commit which broke it for me. I need 
to look back later to see how to change the off-tree board config to get 
it back online.

Just noticed that the error is somewhat similar, although coming from 
different build env. But in my case it is likely that I need to adapt 
the cmake build scripts according to the changes in nuttx.

-Jukka



On 3.3.2022 9.37, Petro Karashchenko wrote:
> Hello Jukka,
>
> So you experience the same problem as Daniel and reverting the commit helps?
>
> Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
> reuse common code from "nuttx/board/...". I'm using a custom board
> based on SAME70 and after
> https://github.com/apache/incubator-nuttx/pull/4981 I found my code
> tree broken. Now the folder structure for "boards/arm/samv7" is the
> same as in "boards/arm/stm32". Here is what I did to get it back
> running:
> 1. Synced "custom-board/scripts/Make.defs" with
> "boards/arm/samv7/same70-xplained/scripts/Make.defs"
> 2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
> and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
> 3. Removed files in my code tree that have exactly the same
> implementation as files from "boards/arm/samv7/common"
>
> It seems like Daniel is hitting the same issue, so I expect that
> renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
> should fix the issue without any additional file clean-up.
> Please give me feedback if that helps.
>
> Best regards,
> Petro
>
> чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
>> HI,
>>
>> Not sure what is the correct way to fix this, but I reverted:
>>
>> "
>>
>> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
>> Author: Petro Karashchenko <pe...@gmail.com>
>> Date:   Wed Jan 19 11:16:11 2022 +0200
>>
>>       tools: add option to reuse boards common files for custom boards
>>
>>       Signed-off-by: Petro Karashchenko <pe...@gmail.com>
>> "
>>
>> Petro, what is the proper way to configure this?
>>
>> Thanks,
>>
>> Jukka
>>
>>
>>
>> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
>>
>>> Hi guys,
>>>
>>> I am having problems building custom boards outside of the Nuttx folder
>>> tree. Usually I use the following folder structure.
>>>
>>> |-> apps
>>> |-> my-folder
>>>      |-> my-apps
>>>         |-> custom-app
>>>      |-> my-boards
>>>         |-> custom-board
>>> |-> nuttx
>>>
>>> To build my apps I just need to create a symbolic link called external
>>> inside apps folder. To create a new custom board I start copying a similar
>>> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
>>>
>>> *remove from defconfig:*
>>> CONFIG_ARCH_BOARD="nucleo-g431kb"
>>> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
>>>
>>> *add on defconfig:*
>>> CONFIG_ARCH_BOARD_CUSTOM=y
>>> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
>>> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
>>> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
>>>
>>> *Rename src/Make.defs to src/Makefile and append the line *
>>> include $(TOPDIR)/boards/Board.mk at the end of file.
>>>
>>> This works well for me up to Nuttx version 10.2.0 but now when I try to
>>> make I got the errors
>>>
>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
>>> Create version.h
>>> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
>>> make[2]: Entering directory
>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
>>> Makefile:23: board/Make.defs: No such file or directory
>>> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
>>> make[2]: Leaving directory
>>> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
>>> make[1]: *** [Makefile:79: context] Error 2
>>> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
>>> make: *** [tools/Unix.mk:425: boards/.context] Error 2
>>>
>>> Does anyone know how to fix this problem?
>>>
>>> Thanks
>>>
>>> Daniel Pereira de Carvalho
>>>

Re: Error when building custom board

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Jukka,

So you experience the same problem as Daniel and reverting the commit helps?

Before f77956a227f1db6ecb44eda3814e7b02aa2187a6 there was no way to
reuse common code from "nuttx/board/...". I'm using a custom board
based on SAME70 and after
https://github.com/apache/incubator-nuttx/pull/4981 I found my code
tree broken. Now the folder structure for "boards/arm/samv7" is the
same as in "boards/arm/stm32". Here is what I did to get it back
running:
1. Synced "custom-board/scripts/Make.defs" with
"boards/arm/samv7/same70-xplained/scripts/Make.defs"
2. Renamed "custom-board/src/Makefile" to "custom-board/src/Make.defs"
and synced with "boards/arm/samv7/same70-xplained/src/Make.defs"
3. Removed files in my code tree that have exactly the same
implementation as files from "boards/arm/samv7/common"

It seems like Daniel is hitting the same issue, so I expect that
renaming Makefile to Make.defs plus setting "BOARD_STM32_COMMON=n"
should fix the issue without any additional file clean-up.
Please give me feedback if that helps.

Best regards,
Petro

чт, 3 бер. 2022 р. о 07:40 Jukka Laitinen <ju...@iki.fi> пише:
>
> HI,
>
> Not sure what is the correct way to fix this, but I reverted:
>
> "
>
> commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
> Author: Petro Karashchenko <pe...@gmail.com>
> Date:   Wed Jan 19 11:16:11 2022 +0200
>
>      tools: add option to reuse boards common files for custom boards
>
>      Signed-off-by: Petro Karashchenko <pe...@gmail.com>
> "
>
> Petro, what is the proper way to configure this?
>
> Thanks,
>
> Jukka
>
>
>
> On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:
>
> > Hi guys,
> >
> > I am having problems building custom boards outside of the Nuttx folder
> > tree. Usually I use the following folder structure.
> >
> > |-> apps
> > |-> my-folder
> >     |-> my-apps
> >        |-> custom-app
> >     |-> my-boards
> >        |-> custom-board
> > |-> nuttx
> >
> > To build my apps I just need to create a symbolic link called external
> > inside apps folder. To create a new custom board I start copying a similar
> > board (e.g nucleo-g431kb) to my-boards folder and make the following changes
> >
> > *remove from defconfig:*
> > CONFIG_ARCH_BOARD="nucleo-g431kb"
> > CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
> >
> > *add on defconfig:*
> > CONFIG_ARCH_BOARD_CUSTOM=y
> > CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> > CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> > CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
> >
> > *Rename src/Make.defs to src/Makefile and append the line *
> > include $(TOPDIR)/boards/Board.mk at the end of file.
> >
> > This works well for me up to Nuttx version 10.2.0 but now when I try to
> > make I got the errors
> >
> > make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> > Create version.h
> > make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > make[2]: Entering directory
> > '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > Makefile:23: board/Make.defs: No such file or directory
> > make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> > make[2]: Leaving directory
> > '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> > make[1]: *** [Makefile:79: context] Error 2
> > make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> > make: *** [tools/Unix.mk:425: boards/.context] Error 2
> >
> > Does anyone know how to fix this problem?
> >
> > Thanks
> >
> > Daniel Pereira de Carvalho
> >

Re: Error when building custom board

Posted by Jukka Laitinen <ju...@iki.fi>.
HI,

Not sure what is the correct way to fix this, but I reverted:

"

commit f77956a227f1db6ecb44eda3814e7b02aa2187a6
Author: Petro Karashchenko <pe...@gmail.com>
Date:   Wed Jan 19 11:16:11 2022 +0200

     tools: add option to reuse boards common files for custom boards

     Signed-off-by: Petro Karashchenko <pe...@gmail.com>
"

Petro, what is the proper way to configure this?

Thanks,

Jukka



On 3.3.2022 0.06, Daniel Pereira Carvalho wrote:

> Hi guys,
>
> I am having problems building custom boards outside of the Nuttx folder
> tree. Usually I use the following folder structure.
>
> |-> apps
> |-> my-folder
>     |-> my-apps
>        |-> custom-app
>     |-> my-boards
>        |-> custom-board
> |-> nuttx
>
> To build my apps I just need to create a symbolic link called external
> inside apps folder. To create a new custom board I start copying a similar
> board (e.g nucleo-g431kb) to my-boards folder and make the following changes
>
> *remove from defconfig:*
> CONFIG_ARCH_BOARD="nucleo-g431kb"
> CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
>
> *add on defconfig:*
> CONFIG_ARCH_BOARD_CUSTOM=y
> CONFIG_ARCH_BOARD_CUSTOM_DIR="../my-folder/my-boards/custom-board"
> CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
> CONFIG_ARCH_BOARD_CUSTOM_NAME="custom-board"
>
> *Rename src/Make.defs to src/Makefile and append the line *
> include $(TOPDIR)/boards/Board.mk at the end of file.
>
> This works well for me up to Nuttx version 10.2.0 but now when I try to
> make I got the errors
>
> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/tools'
> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/tools'
> Create version.h
> make[1]: Entering directory '/home/daniel/nuttx-workspace/nuttx/boards'
> make[2]: Entering directory
> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> Makefile:23: board/Make.defs: No such file or directory
> make[2]: *** No rule to make target 'board/Make.defs'.  Stop.
> make[2]: Leaving directory
> '/home/daniel/nuttx-workspace/nuttx/boards/arm/stm32/common'
> make[1]: *** [Makefile:79: context] Error 2
> make[1]: Leaving directory '/home/daniel/nuttx-workspace/nuttx/boards'
> make: *** [tools/Unix.mk:425: boards/.context] Error 2
>
> Does anyone know how to fix this problem?
>
> Thanks
>
> Daniel Pereira de Carvalho
>