Hello CircuitDojo Community,
I am developing firmware on a Sparkfun Thing Plus nRF9160 board, and recently got some good help here regarding Zephyr out-of-tree driver authoring. I’m now working to extend a Nordic sample app, the
ncs/nrf/samples/nrf9160/aws_iot sample project from Nordic’s nrf-sdk version 1.6.1. I’m able to build and to flash this sample to the Sparkfun Thing Plus. A next natural development step seems to be to copy the sample app to a separate out-of-Nordic-SDK location, and build it there.
aws_iot to such a stand alone location. None of Nordic’s sample apps have a
./zephyr/west.yml file, but immediately after copying, I invoke
west init in the copy of this app I wish to extend and build on. This action pulls down latest stable Zephyr release, but build fails for lack of
thing91_nrf9160 directory and board files in `[stand-alone-location]/aws_iot/zephyr/boards/arm/.
Though I’m calling
west init && west update inside a copy of
aws_iot it appears I’m getting latest stable Zephyr code release and board files, rather than Nordic’s fork of Zephyr and Nordic’s choice of supported boards in nrf-sdk.
[stand-alone-location]/aws_iot/zephyr/boards/arm/ resolves that first issue of “board not found”. Next issues are a series of undefined CONFIG_ type symbols. I’ve spent some hours now locating these symbols defined in Kconfig files of Nordic’s nrf code base. Where it made sense I copied a couple Kconfig file over to the “stand alone” app area. Elsewhere I amended one aws_iot Kconfig to point to other Kconfigs, each time resolving some of the undefined symbols errors. This effort however does not seem like the correct way to extract one sample app from a larger SDK and extend it with additional code. And I’m not out of the woods with these errors yet.
Is there a more straight-forward or correct way to determine a sample app’s dependencies? Is my thinking right or wrong, that a sample app may be copied away from its SDK samples folder and then extended from that copy?
Thirdly, how can one track down a sample app’s dependencies? I find no west.yml manifest file in the sample app folder nor a .west/module.yml file. The sample aws_iot
CMakeLists.txt doesn’t give much clue for dependencies either.
aws_iot the file prj.conf expresses which radio and run time features are enabled, but doesn’t make most of those features known to Zephyr’s build tools. The other sample app files don’t seem to express any specific references to modules nor libraries such as mqtt either:
Am I going about this wrong, or is it reasonable to copy a single app and build it outside of nrf-sdk?