w8jcik opened a new issue #2206:
URL: https://github.com/apache/incubator-nuttx/issues/2206


   ## Setup
   
   With following directory structure
   
   ```
   /base
       /nuttx (incubator-nuttx)
       /apps (incubator-nuttx-app)
   /board (empty folder)
   ```
   
   ```
   cd base/nuttx ; ./configure.sh hymini-stm32v:nsh2
   ```
   
   Bulids and runs.
   
   Then I try to use `CONFIG_ARCH_BOARD_CUSTOM` functionality, with 
`hymini-stm32v:nsh2`, by making a copy of it and trying to build NuttX. This 
particular board is just an example.
   
   ## First attempt
   
   Copied content of 
https://github.com/apache/incubator-nuttx/tree/master/boards/arm/stm32/hymini-stm32v
 into `/board`.
   
   Using `make menuconfig` selected
   
   ```
   CONFIG_ARCH_BOARD_CUSTOM=y
   CONFIG_ARCH_BOARD_CUSTOM_NAME=custom-board  # description says it is not 
relevant
   CONFIG_ARCH_BOARD_CUSTOM_DIR=../../board
   CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
   ```
   
   Issues at this step:
   1) If I specify `CONFIG_ARCH_BOARD_CUSTOM_DIR` wrongly, it is not possible 
to run `make menuconfig` anymore.
   2) If I specify correctly, it is not building.
   
   
   
   ## Second attempt
   
   I guess `tools/configure.sh` should be used for this somehow
   
   ```
   tools/configure.sh -h  # doesn't give any related help
   
   USAGE: tools/configure.sh [-E] [-e] [-l|m|c|g|n] [L] [-a <app-dir>] 
<board-name>:<config-name> [make-opts]
   
   Where:
     -E enforces distclean if already configured.
     -e performs distclean if configuration changed.
     -l selects the Linux (l) host environment.
     -m selects the macOS (m) host environment.
     -c selects the Windows host and Cygwin (c) environment.
     -g selects the Windows host and MinGW/MSYS environment.
     -n selects the Windows host and Windows native (n) environment.
     Default: Use host setup in the defconfig file
     Default Windows: Cygwin
     -L  Lists all available configurations.
     -a <app-dir> is the path to the apps/ directory, relative to the nuttx
        directory
     <board-name> is the name of the board in the boards directory
     configs/<config-name> is the name of the board configuration sub-directory
     make-opts directly pass to make
   
   tools/configure.sh ../../board  # refuses
   File Make.defs could not be found
   
   tools/configure.sh ../../board:nsh2 # refuses
   Directory for ../../board:nsh2 does not exist.
   
   tools/configure.sh ../../board/configs/nsh2  # this works, but it is not 
consistent with normal usage of this command and absent from help or 
documentation
   ```
   
   It builds, but it just configures `hymini-stm32v:nsh2` as far as I can tell.
   
   So I am changing `/board/configs/nsh2/defconfig`
   
   ```diff
   -CONFIG_ARCH_BOARD="hymini-stm32v"
   -CONFIG_ARCH_BOARD_HYMINI_STM32V=y
   
   +CONFIG_ARCH_BOARD_CUSTOM=y
   +CONFIG_ARCH_BOARD_CUSTOM_NAME=custom-board
   +CONFIG_ARCH_BOARD_CUSTOM_DIR=../../board
   +CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
   ```
   
   It is not building afterwards.
   
   ```
   make distclean
   tools/configure.sh ../../board/configs/nsh2
   ```
   
   ```
   make[2]: Nothing to be done for 'clean_context'.
   make[2]: Leaving directory '/home/user/dev/project/base/nuttx/arch/arm/src'
   make[1]: Leaving directory '/home/user/dev/project/base/nuttx/tools'
   make[1]: Leaving directory '/home/user/dev/project/base/nuttx'
   Create version.h
   LN: include/arch to arch/arm/include
   LN: arch/arm/src/board to /home/user/dev/project/base/nuttx//src
   LN: arch/arm/src/chip to arch/arm/src/stm32
   LN: /home/user/dev/project/base/nuttx/drivers/platform to 
/home/user/dev/project/base/nuttx/drivers/dummy
   No directory at /home/user/dev/project/base/nuttx//src
   make: *** [tools/Makefile.unix:293: arch/arm/src/board] Error 1
   ```
   
   ## Conclusion
   
   This functionality is difficult to use.  
   Receipe for doing this is missing from documentation.  
   
   I am not sure what I am missing, analysed Makefiles a bit and searched 
through different mailing lists of NuttX with some solutions present there, but 
it doesn't help me solve this. It would be great if it would be easier.
   
   Reading this doesn't help
   - 
https://nuttx.apache.org/docs/latest/quickstart/organization.html#boardsdirectorystructure
   - https://cwiki.apache.org/confluence/display/NUTTX/Platform+Directories


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to