Hi Jared. This may be a very basic question: where is, or how do I determine, the outside-of-app file to change so drivers needed by the app are built first?
At this point now I’ve spent a good ten plus hours searching, reading, and experimenting with various suggested example changes to correctly “inform” my project of the larger Nordic SDK in which it lives. This has only become an issue as I implement a local driver.
I’ve reviewed each of your replies, again much appreciated, and I’ve looked pretty extensively over the pyrinas project you have on github. When I add a Kconfig.kx132 in the top dir of my example app, a file analogous to Kconfig.pyrinas, this causes all of the blinky driver enable flags to become undefined. Without this app top-level Kconfig file, only my newly drafted driver flag CONFIG_KX132_1211
is not found by cmake
and reported as undefined.
Where exactly should a variable such as CONFIG_PCF85063A
be defined? I find many references to Zephyr’s official driver CONFIG_ flags, but no place in the Zephyr 2.6.0 cloned repository, nor the ncs 1.6.1 repository where any of these flags are pound defined.
As for knowing the context of my example app, I know that I am using for my SDK, ncs v1.6.1
. I know which directory is the root dir of this SDK where I ran west init
. I know the path from this SDK root to the basic\blinky
example, and likewise to my modified version of that example app. But if to “include my driver outside my app” requires a “within app” change, it is unclear to me which file and which stanzas to change.
You state I “must include my drivers outside of my application”. How does one include one’s drivers outside of their application? Must modify a file outside my app in the larger SDK, or a file within my app?
Looking at the original Nordic ncs 1.6.1 / Zephyr basic/blinky
app, I see there is a CMakeLists.txt
file but no Kconfig
file. The CMakeLists.txt file contains:
# SPDX-License-Identifier: Apache-2.0
2
3 cmake_minimum_required(VERSION 3.13.1)
4 find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5 project(blinky)
6
7 target_sources(app PRIVATE src/main.c)
If I follow your blog post tutorial verbatim, I would overwrite this file with something like the following pyrinas, app-top-level-directory CMakeLists.txt file:
#
# Copyright (c) 2020 Circuit Dojo
#
# SPDX-License-Identifier: Apache-2.0
#
# Point to Pyrinas root directory.
set(PYRINAS_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "Pyrinas root directory")
zephyr_include_directories(include)
add_subdirectory(lib)
add_subdirectory(ext)
add_subdirectory(drivers)
In adding this file to my project I would substitute my project name for ‘pyrinas’, but I’m concerned to delete the find_package()
and target_sources()
stanzas that are present in my pre-existing CMakeLists.txt file. This file pre-exists because my app is copied from basic/blinky
. At this time I also do not have an ext
nor lib
subdirectly in my example app project.
I’m willing to put in the hours to learn this new material, but as I’m building on an existing example and not from scratch, I need to know which parts of the example are ok to overwrite versus those which must stay in place. This so if I am to follow the blog instructions as close as possible and make them work.