SERIAL_HAS_DRIVER error in DevAcademy Intermediate Lesson 9

Hello,

I am trying to build the Lesson 9 Exercise 1 in the DevAcademy Intermediate course, related to DFU. I get the following error:

error: SERIAL_HAS_DRIVER (defined at drivers/serial/Kconfig:15) is assigned in a configuration file,
but is not directly user-configurable (has no prompt). It gets its value indirectly from other
symbols. See docs.zephyrproject.org/.../kconfig.html and/or look
up SERIAL_HAS_DRIVER in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.

This happens when trying to build in step 2, that is, having added the following lines to sysbuild.conf:
SB_CONFIG_BOOTLOADER_MCUBOOT=y
SB_CONFIG_MCUBOOT_MODE_SINGLE_APP=y

And these to sysbuild/mcuboot.conf:
CONFIG_LOG=y
CONFIG_MCUBOOT_LOG_LEVEL_INF=y

The same error is reported when building the solution. It is also independent of the selected board target (it happens with both nrf5340dk/nrf5340/cpuapp and cpuapp/ns). Since this fails when trying to run the first build, I am not able to use the Kconfig tool to see the configuration.

Regarding my build configuration, I am using nRF Connect SDK v2.9.1 with Toolchain v2.9.0. The board target is chosen to be a Nordic SoC (selecting "Nordic Kits" does not make any difference). File prj.conf is selected as the base configuration file. All other settings are left empty as per default.

Since this is happening with the solution to an exercise, I assume somebody else has been already able to build it. Do you have any clue on what could be running wrong on my system?

Thank you very much in advance.

 *  Executing task: nRF Connect: Generate config nrf5340dk/nrf5340/cpuapp/ns for c:\mahle_ecp\nrftraining\ncs-inter\l9_e1_sol

Building l9_e1_sol
C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir c:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/build c:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol --pristine --board nrf5340dk/nrf5340/cpuapp/ns -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=prj.conf"

-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: C:/ncs/toolchains/b620d30767/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/ncs/v2.9.1/zephyr/.cache
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf5340dk, qualifiers: nrf5340/cpuapp/ns
Parsing C:/ncs/v2.9.1/zephyr/share/sysbuild/Kconfig
Loaded configuration 'C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/build/_sysbuild/empty.conf'
Merged configuration 'c:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/sysbuild.conf'
Configuration saved to 'C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/build/zephyr/.config'
Kconfig header saved to 'C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/build/_sysbuild/autoconf.h'
--
   *****************************
   * Running CMake for mcuboot *
   *****************************

Loading Zephyr default modules (Zephyr base).
-- Application: C:/ncs/v2.9.1/bootloader/mcuboot/boot/zephyr
-- CMake version: 3.21.0
-- Found Python3: C:/ncs/toolchains/b620d30767/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/ncs/v2.9.1/zephyr/.cache
-- Zephyr version: 3.7.99 (C:/ncs/v2.9.1/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
-- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b620d30767/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b620d30767/opt/zephyr-sdk)
-- Found Dtc: C:/ncs/toolchains/b620d30767/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found BOARD.dts: C:/ncs/v2.9.1/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
-- Found devicetree overlay: C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/sysbuild/mcuboot.overlay
-- Generated zephyr.dts: C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_generated.h: C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/build/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/build/mcuboot/zephyr/dts.cmake

error: SERIAL_HAS_DRIVER (defined at drivers/serial/Kconfig:15) is assigned in a configuration file,
but is not directly user-configurable (has no prompt). It gets its value indirectly from other
symbols. See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SERIAL_HAS_DRIVER and/or look
up SERIAL_HAS_DRIVER in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.

Parsing C:/ncs/v2.9.1/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration 'C:/ncs/v2.9.1/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
Merged configuration 'C:/ncs/v2.9.1/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration 'C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/sysbuild/mcuboot.conf'
Merged configuration 'C:/ncs/v2.9.1/nrf/modules/mcuboot/tfm.conf'
Merged configuration 'C:/ncs/v2.9.1/nrf/modules/mcuboot/fih_low_enable.conf'
Merged configuration 'C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/build/mcuboot/zephyr/.config.sysbuild'
CMake Error at C:/ncs/v2.9.1/zephyr/cmake/modules/kconfig.cmake:396 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  C:/ncs/v2.9.1/nrf/cmake/modules/kconfig.cmake:29 (include)
  C:/ncs/v2.9.1/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
  C:/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  C:/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:12 (find_package)


-- Configuring incomplete, errors occurred!
CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
  CMake configure failed for Zephyr project: mcuboot

  Location: C:/ncs/v2.9.1/bootloader/mcuboot/boot/zephyr/
Call Stack (most recent call first):
  cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
  cmake/modules/sysbuild_default.cmake:20 (include)
  C:/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
  C:/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  C:/ncs/v2.9.1/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
  template/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/mahle_ecp/nrftraining/ncs-inter/l9_e1_sol/build/CMakeFiles/CMakeOutput.log".
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/b620d30767/opt/bin/python.exe '-Bc:\mahle_ecp\nrftraining\ncs-inter\l9_e1_sol\build' -GNinja -DBOARD=nrf5340dk/nrf5340/cpuapp/ns -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=prj.conf '-SC:\ncs\v2.9.1\zephyr\share\sysbuild' '-DAPP_DIR:PATH=c:\mahle_ecp\nrftraining\ncs-inter\l9_e1_sol'

 *  The terminal process terminated with exit code: 1.
 *  Terminal will be reused by tasks, press any key to close it.

Parents Reply Children
  • Hi Dazai,

    I have just tried both choices: either to add CONFIG_SERIAL_HAS_DRIVER to prj.conf, or excluding the prj.conf file from the build. In both cases I obtain the same output, the builder still complains that this option should not be user-configurable.

    Accordig to the documentation, it should be automatically selected when any driver that depends on it is enabled. Hence, I have also tried adding CONFIG_SERIAL=y to the prj.conf file and including it again in the build, but the result is still the same.

  • Hello, 

    I've been in contact with the responsible resources for the DevAcademy Intermediate course. They have not been able to reproduce. Any changes you have added?  

    Alejandro Navarro said:
    add CONFIG_SERIAL_HAS_DRIVER to prj.conf

    This config is not meant to be set by user. Have you tried to search through your SDK or the menuconfig to see if this is enabled anywhere?

    Kind regards,
    Øyvind

  • Hello,

    I have not tried anything new so far. CONFIG_SERIAL_DRIVER=y is set only in the default board configuration (zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig), so that should not be recognized as "configured by the user"; there are no more occurrences of this symbol.

    How does their build configuration for this project look like? Maybe the root cause lies there.

    Kind regards,

    Alejandro

  • Hello again,

    I have found out that file boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig had the following line, which should not be there (as of commit ca954a62, tag  v3.7.99-ncs2-1):

    CONFIG_SERIAL_HAS_DRIVER=y

    Removing that line (that is, discarding changes not commited) solves the issue.

    Just to make sure, could you please check on your side that the mentioned line effectively does not belong to the _defconfig file? If so, then we can close the issue.

    Thank you very much in advance.

  • Alejandro Navarro said:
    Just to make sure, could you please check on your side that the mentioned line effectively does not belong to the _defconfig file? If so, then we can close the issue.

    Looking through misc. commits in the repo, I can't see that CONFIG_SERIAL_HAS_DRIVER=y has ever been a part of the nrf5340dk_nrf5340_cpuapp_defconfig. 

    E.g. here is a comparison to tag v3.6.99-ncs2

    I'm glad you were able to find the culprit. 

    Kind regards,
    Øyvind

Related