You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Aaron M <aa...@minn-tek.com> on 2024/12/19 08:00:30 UTC

How do I build for different boards?

Sorry if this is inappropriate for the list, but I'm a relative noob to 
Nuttx, and I'm just trying to find my way.  I'll go elsewhere if you 
point me in the correct direction for questions like this.

My exposure to Nuttx has been strictly limited to Sony's Spresense, and 
I have a suitable working environment in VSCode with Sony's SDK.  But if 
I want to build for, say, the FRDM KL-25, or the RPi Pico 2, can I use 
the same environment, er, somehow?  Do I need to download separate 
copies of the repo of Nuttx for each board?

This link has a nice overview, but it doesn't cover how to handle 
multiple boards:
https://www.cocoacrumbs.com/blog/2021-10-25-nuttx-on-the-stm32f769-disco-board/ 


Thanks for any insight, and my deepest apologies if this is the wrong 
place for these questions.

Aaron

Re: How do I build for different boards?

Posted by Laczen JMS <la...@gmail.com>.
Hi Alan,

Thank you for the quick reply. The proposed method would indeed work.
To enhance it I could even use a little script to update the "mynsh"
in the external directory (to support multiple defconfigs).

The symbolic link however shows up as a difference in the repository
and this complicates keeping nuttx in sync with github.

I will have a look whether it is not easier to use the custom boards approach.

Kind regards,

Jehudi

Op do 19 dec 2024 om 15:36 schreef Alan C. Assis <ac...@gmail.com>:

>
> Hi Laczen,
>
> Good question, normally we use CustomBoards (AKA: out-tree or
> out-of-the-tree boards) to have a separated board from mainline:
>
> https://nuttx.apache.org/docs/latest/guides/customboards.html
>
> But I think your case is different, you only want to use your defconfig
> separated from mainline, correct?
>
> In this case just use a symbolic link will work, enter inside
> boards/yourarch/yourfamily/yourboard/configs/ and create a symbolic link to
> the external directory where you board profile with defconfig is located:
>
> Example:
> $ cd boards/arm/stm32/stm32f4discovery/configs/
> $ ln -s /home/user/boardconfigs/mynsh mynsh
> $ cd -
> $ ./tools/configure.sh stm32f4discovery:mynsh
> $ make -j
>
> BR,
>
> Alan
>
> On Thu, Dec 19, 2024 at 6:46 AM Laczen JMS <la...@gmail.com> wrote:
>
> > Hi Alan and Aaron,
> >
> > I am also a noob and facing what I think is a similar problem. I would
> > like to create some specific configuration (defconfig) outside of the
> > nuttx folder while maintaining my nuttx folder free from changes so
> > that I can keep the nuttx folder in sync with the repo. What is the
> > best way to achieve this ?
> >
> > Kind regards,
> >
> > Jehudi
> >
> > Op do 19 dec 2024 om 09:28 schreef Alan C. Assis <ac...@gmail.com>:
> > >
> > > Hi Aaron,
> > >
> > > Nice to know you have previous experience with NuttX on Sony Spresense.
> > >
> > > The process to support other boards is very similar, I suggest you to
> > read
> > > our official documentation:
> > >
> > > https://nuttx.apache.org/docs/latest/quickstart/index.html
> > >
> > > If you still have questions, please feel free to ask here. Also if you
> > > notice that there is something you expected to find in our documentation
> > > and it is not there, please let us know, this way we can improve it.
> > >
> > > BR,
> > >
> > > Alan
> > >
> > > On Thu, Dec 19, 2024 at 5:02 AM Aaron M <aa...@minn-tek.com>
> > wrote:
> > >
> > > > Sorry if this is inappropriate for the list, but I'm a relative noob to
> > > > Nuttx, and I'm just trying to find my way.  I'll go elsewhere if you
> > > > point me in the correct direction for questions like this.
> > > >
> > > > My exposure to Nuttx has been strictly limited to Sony's Spresense, and
> > > > I have a suitable working environment in VSCode with Sony's SDK.  But
> > if
> > > > I want to build for, say, the FRDM KL-25, or the RPi Pico 2, can I use
> > > > the same environment, er, somehow?  Do I need to download separate
> > > > copies of the repo of Nuttx for each board?
> > > >
> > > > This link has a nice overview, but it doesn't cover how to handle
> > > > multiple boards:
> > > >
> > > >
> > https://www.cocoacrumbs.com/blog/2021-10-25-nuttx-on-the-stm32f769-disco-board/
> > > >
> > > >
> > > > Thanks for any insight, and my deepest apologies if this is the wrong
> > > > place for these questions.
> > > >
> > > > Aaron
> > > >
> >

Re: How do I build for different boards?

Posted by Tomek CEDRO <to...@cedro.info>.
On Thu, Dec 19, 2024 at 7:20 PM Gregory Nutt <sp...@gmail.com> wrote:
> On 12/19/2024 12:07 PM, Tomek CEDRO wrote:
> > On Thu, Dec 19, 2024 at 4:43 PM Gregory Nutt <sp...@gmail.com> wrote:
> >> I remember some discussion about a PR to support traditional out-of-tree
> >> builds.  Was that not merged?
> > I do not recall but indeed having untouched git clone (or submodule)
> > with no symlinks inside sounds best.. most people prefer that way me
> > included :-)
>
> Perhaps someone with knowledge can correct me, but traditional
> out-of-tree builds that do not modify the source is only available with
> CMake and probably only for RISC-V and possibly ARM-64. Based on 'git
> log' comments.
>
> See also "Out-of-tree building" in
> https://nuttx.apache.org/docs/latest/quickstart/compiling_cmake.html

Hmm, maybe then we could add some sort of standard -1 level directory
to store out-of-tree stuff to be optionally searched by the
conventional Make build system? :-)

For instance:
./nuttx
./nuttx-apps
./nuttx-ext

This could allow searching for some additional boards/configs/apps in
the ./nuttx-ext (name example only) and if that dir does not exist
then its simply skipped?

Just an idea :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

Re: How do I build for different boards?

Posted by Tomek CEDRO <to...@cedro.info>.
On Thu, Dec 19, 2024 at 4:43 PM Gregory Nutt <sp...@gmail.com> wrote:
> I remember some discussion about a PR to support traditional out-of-tree
> builds.  Was that not merged?

I do not recall but indeed having untouched git clone (or submodule)
with no symlinks inside sounds best.. most people prefer that way me
included :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

Re: How do I build for different boards?

Posted by Gregory Nutt <sp...@gmail.com>.
I remember some discussion about a PR to support traditional out-of-tree 
builds.  Was that not merged?

Re: How do I build for different boards?

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi Laczen,

Good question, normally we use CustomBoards (AKA: out-tree or
out-of-the-tree boards) to have a separated board from mainline:

https://nuttx.apache.org/docs/latest/guides/customboards.html

But I think your case is different, you only want to use your defconfig
separated from mainline, correct?

In this case just use a symbolic link will work, enter inside
boards/yourarch/yourfamily/yourboard/configs/ and create a symbolic link to
the external directory where you board profile with defconfig is located:

Example:
$ cd boards/arm/stm32/stm32f4discovery/configs/
$ ln -s /home/user/boardconfigs/mynsh mynsh
$ cd -
$ ./tools/configure.sh stm32f4discovery:mynsh
$ make -j

BR,

Alan

On Thu, Dec 19, 2024 at 6:46 AM Laczen JMS <la...@gmail.com> wrote:

> Hi Alan and Aaron,
>
> I am also a noob and facing what I think is a similar problem. I would
> like to create some specific configuration (defconfig) outside of the
> nuttx folder while maintaining my nuttx folder free from changes so
> that I can keep the nuttx folder in sync with the repo. What is the
> best way to achieve this ?
>
> Kind regards,
>
> Jehudi
>
> Op do 19 dec 2024 om 09:28 schreef Alan C. Assis <ac...@gmail.com>:
> >
> > Hi Aaron,
> >
> > Nice to know you have previous experience with NuttX on Sony Spresense.
> >
> > The process to support other boards is very similar, I suggest you to
> read
> > our official documentation:
> >
> > https://nuttx.apache.org/docs/latest/quickstart/index.html
> >
> > If you still have questions, please feel free to ask here. Also if you
> > notice that there is something you expected to find in our documentation
> > and it is not there, please let us know, this way we can improve it.
> >
> > BR,
> >
> > Alan
> >
> > On Thu, Dec 19, 2024 at 5:02 AM Aaron M <aa...@minn-tek.com>
> wrote:
> >
> > > Sorry if this is inappropriate for the list, but I'm a relative noob to
> > > Nuttx, and I'm just trying to find my way.  I'll go elsewhere if you
> > > point me in the correct direction for questions like this.
> > >
> > > My exposure to Nuttx has been strictly limited to Sony's Spresense, and
> > > I have a suitable working environment in VSCode with Sony's SDK.  But
> if
> > > I want to build for, say, the FRDM KL-25, or the RPi Pico 2, can I use
> > > the same environment, er, somehow?  Do I need to download separate
> > > copies of the repo of Nuttx for each board?
> > >
> > > This link has a nice overview, but it doesn't cover how to handle
> > > multiple boards:
> > >
> > >
> https://www.cocoacrumbs.com/blog/2021-10-25-nuttx-on-the-stm32f769-disco-board/
> > >
> > >
> > > Thanks for any insight, and my deepest apologies if this is the wrong
> > > place for these questions.
> > >
> > > Aaron
> > >
>

Re: How do I build for different boards?

Posted by Laczen JMS <la...@gmail.com>.
Hi Alan and Aaron,

I am also a noob and facing what I think is a similar problem. I would
like to create some specific configuration (defconfig) outside of the
nuttx folder while maintaining my nuttx folder free from changes so
that I can keep the nuttx folder in sync with the repo. What is the
best way to achieve this ?

Kind regards,

Jehudi

Op do 19 dec 2024 om 09:28 schreef Alan C. Assis <ac...@gmail.com>:
>
> Hi Aaron,
>
> Nice to know you have previous experience with NuttX on Sony Spresense.
>
> The process to support other boards is very similar, I suggest you to read
> our official documentation:
>
> https://nuttx.apache.org/docs/latest/quickstart/index.html
>
> If you still have questions, please feel free to ask here. Also if you
> notice that there is something you expected to find in our documentation
> and it is not there, please let us know, this way we can improve it.
>
> BR,
>
> Alan
>
> On Thu, Dec 19, 2024 at 5:02 AM Aaron M <aa...@minn-tek.com> wrote:
>
> > Sorry if this is inappropriate for the list, but I'm a relative noob to
> > Nuttx, and I'm just trying to find my way.  I'll go elsewhere if you
> > point me in the correct direction for questions like this.
> >
> > My exposure to Nuttx has been strictly limited to Sony's Spresense, and
> > I have a suitable working environment in VSCode with Sony's SDK.  But if
> > I want to build for, say, the FRDM KL-25, or the RPi Pico 2, can I use
> > the same environment, er, somehow?  Do I need to download separate
> > copies of the repo of Nuttx for each board?
> >
> > This link has a nice overview, but it doesn't cover how to handle
> > multiple boards:
> >
> > https://www.cocoacrumbs.com/blog/2021-10-25-nuttx-on-the-stm32f769-disco-board/
> >
> >
> > Thanks for any insight, and my deepest apologies if this is the wrong
> > place for these questions.
> >
> > Aaron
> >

Re: How do I build for different boards?

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi Aaron,

Nice to know you have previous experience with NuttX on Sony Spresense.

The process to support other boards is very similar, I suggest you to read
our official documentation:

https://nuttx.apache.org/docs/latest/quickstart/index.html

If you still have questions, please feel free to ask here. Also if you
notice that there is something you expected to find in our documentation
and it is not there, please let us know, this way we can improve it.

BR,

Alan

On Thu, Dec 19, 2024 at 5:02 AM Aaron M <aa...@minn-tek.com> wrote:

> Sorry if this is inappropriate for the list, but I'm a relative noob to
> Nuttx, and I'm just trying to find my way.  I'll go elsewhere if you
> point me in the correct direction for questions like this.
>
> My exposure to Nuttx has been strictly limited to Sony's Spresense, and
> I have a suitable working environment in VSCode with Sony's SDK.  But if
> I want to build for, say, the FRDM KL-25, or the RPi Pico 2, can I use
> the same environment, er, somehow?  Do I need to download separate
> copies of the repo of Nuttx for each board?
>
> This link has a nice overview, but it doesn't cover how to handle
> multiple boards:
>
> https://www.cocoacrumbs.com/blog/2021-10-25-nuttx-on-the-stm32f769-disco-board/
>
>
> Thanks for any insight, and my deepest apologies if this is the wrong
> place for these questions.
>
> Aaron
>

Re: How do I build for different boards?

Posted by Tomek CEDRO <to...@cedro.info>.
On Thu, Dec 19, 2024 at 9:02 AM Aaron M <aa...@minn-tek.com> wrote:
> Sorry if this is inappropriate for the list, but I'm a relative noob to
> Nuttx, and I'm just trying to find my way.  I'll go elsewhere if you
> point me in the correct direction for questions like this.

Welcome to the NuttX community Aaron! :-)


> My exposure to Nuttx has been strictly limited to Sony's Spresense, and
> I have a suitable working environment in VSCode with Sony's SDK.  But if
> I want to build for, say, the FRDM KL-25, or the RPi Pico 2, can I use
> the same environment, er, somehow?  Do I need to download separate
> copies of the repo of Nuttx for each board?

Long story short, you can use the same repo clone for totally
different builds, just remember to `make clean distclean` before a new
build. Each new build is initiated with `./tools/configure.sh
[switches] <board:config>`.

For sure you can have multiple repo clones aka workspaces to work on a
different projects in parallel :-)

See documentation :-)

https://nuttx.apache.org/docs/latest/quickstart/index.html


> This link has a nice overview, but it doesn't cover how to handle
> multiple boards:
> https://www.cocoacrumbs.com/blog/2021-10-25-nuttx-on-the-stm32f769-disco-board/

There is another way to deal with the task and many of us use this
approach called "out of tree boards" - you keep one clone of nuttx and
nuttx-apps in one place, and keep your projects in a separate place.

https://nuttx.apache.org/docs/latest/guides/customboards.html


> Thanks for any insight, and my deepest apologies if this is the wrong
> place for these questions.

You are always welcome to ask questions. We often discuss different
tasks and ideas here openly so everyone can learn new stuff and get
better insight / understanding this is our ultimate goal :-)

If you miss something in the documentation you are more than welcome
to send PR with the missing contents.. documentation is part of the
nuttx.git repo :-)

Have fun! :-)
Tomek

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info