nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

Open nRF Connect SDK Project fails when importing project with board.c out of tree source file

Hi,

I'm esperiencing this error when I try to import a project which has board folder inside project folder and board definition include board.c sourcefile (nrf52840dongle_nrf52840),

C:\Users\Luca\ncs\v1.9.1\toolchain\opt\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.

CMake Error at C:/Users/Luca/ncs/v1.9.1/zephyr/cmake/extensions.cmake:421 (add_library):
The target name
"D:__Users__Luca__Documents__nRF52__Peripheral__boards__arm__nrf52840dongle_nrf52840"
is reserved or not valid for certain CMake features, such as generator
expressions, and may result in undefined behavior.
Call Stack (most recent call first):
C:/Users/Luca/ncs/v1.9.1/zephyr/cmake/extensions.cmake:398 (zephyr_library_named)
boards/arm/nrf52840dongle_nrf52840/CMakeLists.txt:3 (zephyr_library)

CMake Error at C:/Users/Luca/ncs/v1.9.1/zephyr/cmake/extensions.cmake:476 (target_sources):
Cannot specify sources for target
"D:__Users__Luca__Documents__nRF52__Peripheral__boards__arm__nrf52840dongle_nrf52840"
which is not built by this project.
Call Stack (most recent call first):
boards/arm/nrf52840dongle_nrf52840/CMakeLists.txt:4 (zephyr_library_sources)

error: cmake failed
create_nordic_project.py failed (1)

I'm able to import whitout problems the project with out tree board difinition which do not require board.c sourcefile (nrf52840dk)_nrf52840.

I'm using windows 10 and Segger IDE and 1.9.1 nRF Connect SDK. My Documens folder is on disk D: whereas SDK is on disk C: standard installation folder.

I need to make changes to board.c file, but for this test I just copied the board definition folders in my project folder in boards/arm subdirectory, without modification.

Here the tree structure:

D:\Users\Luca\Documents\nRF52\Peripheral
 - src
 - CMakeList.txt
 ...
 
D:\Users\Luca\Documents\nRF52\Peripheral\boards\arm\nrf52840dongle_nrf52840
 - board.c
 - CMakeList.txt
 ...

I changed the project makelist file in accordance to Out Of Tree Board sample project, and it works when no board.c source file required.

Here the full log from the importer and project makefile:

Thank you very match for your help.

LucaF

Parents Reply Children
Related