Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build custom board #12122

Open
fdcavalcanti opened this issue Apr 10, 2024 · 5 comments
Open

Can't build custom board #12122

fdcavalcanti opened this issue Apr 10, 2024 · 5 comments

Comments

@fdcavalcanti
Copy link
Contributor

fdcavalcanti commented Apr 10, 2024

Hi everyone,

I'm trying to create a custom board that is based on a Nucleo-144. I want to have this board versioned so I simply copied the directory boads/arm/stm32f7/nucleo-144 to my repository.
On the configs directory, I removed all but one of the configs. On defconfig, I added those lines below CONFIG_ARCH:

CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../test-nucleo-144"
CONFIG_ARCH_BOARD_CUSTOM_NAME="test-nucleo-144"

And commented:

# CONFIG_ARCH_BOARD="nucleo-144"
# CONFIG_ARCH_BOARD_NUCLEO_144=y

Other than that, I removed everything from Kconfig.

I can open menuconfig just fine after executing the configure script with:
./tools/configure.sh -a ../nuttx-apps -l ../../test-nucleo-144/configs/nsh

Running make I get this error:

$ make -j
Create version.h
LN: platform/board to /home/filipe/rad-stm-fw-poc/nuttxspace/nuttx-apps/platform/dummy
Register: nsh
Register: sh
CC:  dirent/lib_opendir.c chip/stm32_allocateheap.c:168:6: warning: #warning "DTCM excluded from the heap" [-Wcpp]
  168 | #    warning "DTCM excluded from the heap"
      |      ^~~~~~~
CPP:  /home/filipe/test/nuttxspace/nuttx/../../test-nucleo-144/scripts/f746-flash.ld-> /home/filipe/test/nuttxspace/nuttx/../../test-nucleo-144/scripts/f746-flash.ld.tmp make[2]: *** No rule to make target 'libboard.a'.  Stop.
make[1]: *** [Makefile:181: board/libboard.a] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [tools/Unix.mk:546: nuttx] Error 2

This issue is very similar to #2206 but I can't seem to make it work.
Any thoughts? I would love to fix this and then improve the custom board documentation.

Thanks.

@acassis
Copy link
Contributor

acassis commented Apr 10, 2024

@fdcavalcanti I just saw that our documentation for custom board is very shallow: https://nuttx.apache.org/docs/latest/guides/customboards.html# we need something like Custom Apps that @TimJTi wrote.

The error means that some Makefile rules or path to create libboard.a is missing.

BTW, if this board is a commercial board (i.e. from ST) then it is better to add it as official board into NuttX mainline.

@fdcavalcanti
Copy link
Contributor Author

Hi @acassis. Its not a commercial board. I'm using a Nucleo-144 integrating in a different equipment as a proof of concept. Its just easier for me to version only the board files and use the custom board settings.

@TimJTi
Copy link
Contributor

TimJTi commented Apr 10, 2024

@fdcavalcanti - have you tried the instructions to move it completely out-of-tree? It works for me.

@acassis - I "ported" the custom boards stuff from the old Wiki (Confluence?) to the current documentation tree and added a bit to it too if I recall. I will revisit it tomorrow and see if it still holds true or needs enhancement - but it is only for out-of-tree boards. I think there's different documentation somewhere or other for in-tree new boards - I'll look, and see if it needs any work that I can see.

@fdcavalcanti
Copy link
Contributor Author

Hello @TimJTi thanks for the input.
Yes I tried. I also applied the modifications in the issue description above.
This is really an issue now because I think porting to a similar board, out-of-tree, should been simple. I need to do this PoC and am stuck in what seems to be a basic issue.

I'll keep trying to figure it out and hopefully I can contribute on fixing and documenting.

Thanks

@fdcavalcanti
Copy link
Contributor Author

Right, so I got it to compile by reading some issues from make export in #10388
Just had to add CONFIG_ARCH_BOARD_COMMON=y.
I understand that there is a common directory inside boards/stm32f7 but since no defconfig had it, I didn't even think about it before.
I'll keep working on it, try and track down other issues and I'll update the docs.

Thanks everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants