On Fri, May 19, 2023 at 2:24 PM Milan Obuch wrote:
>
> Hi,
>
> I started testing NuttX on Raspberry Pi Pico board, using FreeBSD as
> host for building. I was able to build NuttX using all configuration
> files for this board (but one - nshsram, it does not finish, but I
> don't care about it for now). All those configurations use default UART
> placement (pins 0, 1).
>
> These pins are not available on 01space board RP2040-0.42LCD, so I
> changed UART placement to pins 28, 29 running 'make menuconfig'. This
> way, .config in NuttX working/build directory is modified, and
> resulting binary (or uf2 for this board) file works as expected.
>
> This file, however, gets deleted when running 'make distclean' for
> different build. Thus I run 'make savedefconfig', altering defconfig
> file in working directory. This gets deleted on 'make distclean' as
> well, so I manually created new directory, where I copied defconfig
> file - boards/arm/rp2040/raspberrypi-pico/configs/nsh_28_29, and now my
> config is listed in 'tools/configure.sh -L' output, so I can use it as
> any other config file.
>
> So my questions now - is this intended way for saving and reusing
> config file? While it works for me, I'd like to have my configs
> separated from standard source files, maybe as third parallel directory
> to standard nuttx and apps, with ability to see them in
> 'tools/configure.sh -L' output, and using my configuration with
> 'tools/configure.sh <my_config>'.
>
> Any hints for this one?

Hey there Milan my fellow BSD daemon :-) :-)

I am also working that way.. because nuttx and nuttx-apps are git
submodules of my project repo and I want to work on a release and this
is the cleanest way to maintain. Also I have a custom board. I keep my
custom application and board definition outside those two release
directories according to these hints:

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

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

You can create your own board definition based on existing board
definition, just copy whole directory, update names, and update
required pin definitions.

If the board differs a lot and it is not yet in the upstream you can
send a PR so everyone also can use it :-)

Note that board is just kind of description and setup of the "hardware
product", while all common code resides in the arch/ (MCU with
internal peripherals) and drivers/ (external peripherals onboard).

https://github.com/apache/nuttx/tree/master/arch

https://github.com/apache/nuttx/tree/master/drivers

Here is the full description of the directory structure:

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

I noticed that some boards definitions are more kind of template
rather than ready for use fully featured setups (i.e. devkits with not
much peripherals onboard). User needs to adapt these boards
configuration for particular needs. I guess this was done so far
directly in the source code. But with custom board approach you can
just copy selected board config and update it as you wish.

Hope that helps :-)
Tomek

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

Reply via email to