This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Building udp example from command line

I have built several examples in nRF Connect SDK on MacOS and they seem to work OK.

Now trying to build the udp example

I have left the configuration as it was.

I build in the usual way 

  west build -b nrf9160dk_nrf9160 -p

  gives  

paul_tanner@iMac udp % west build -b nrf9160dk_nrf9160 -p 

-- west build: making build dir /Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/samples/nrf9160/udp/build pristine

-- west build: generating a build system

Including boilerplate (Zephyr base): /Users/paul_tanner/Nordic/nrfsrc/ncs/zephyr/cmake/app/boilerplate.cmake

-- Application: /Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/samples/nrf9160/udp

-- Zephyr version: 2.4.0 (/Users/paul_tanner/Nordic/nrfsrc/ncs/zephyr)

-- Found Python3: /usr/local/bin/python3.7 (found suitable exact version "3.7.7") found components: Interpreter

-- Found west (found suitable version "0.7.2", minimum required is "0.7.1")

-- Board: nrf9160dk_nrf9160

-- Cache files will be written to: /Users/paul_tanner/Library/Caches/zephyr

-- Found dtc: /usr/local/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")

-- Found toolchain: gnuarmemb (/Applications/ARM)

-- Found BOARD.dts: /Users/paul_tanner/Nordic/nrfsrc/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts

nrf9160dk_nrf9160.dts.pre.tmp:56.42-68.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)

nrf9160dk_nrf9160.dts.pre.tmp:305.19-311.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)

-- Generated zephyr.dts: /Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/samples/nrf9160/udp/build/zephyr/zephyr.dts

-- Generated devicetree_unfixed.h: /Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/samples/nrf9160/udp/build/zephyr/include/generated/devicetree_unfixed.h

Parsing /Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/samples/nrf9160/udp/Kconfig

Loaded configuration '/Users/paul_tanner/Nordic/nrfsrc/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'

Merged configuration '/Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/samples/nrf9160/udp/prj.conf'

warning: BSD_LIBRARY (defined at /Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/lib/bsdlib/Kconfig:8) was

assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies:

TRUSTED_EXECUTION_NONSECURE (=n). See

docs.zephyrproject.org/.../CONFIG_BSD_LIBRARY.html and/or look up

BSD_LIBRARY 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.

warning: UART_CONSOLE (defined at drivers/console/Kconfig:47) was assigned the value 'y' but got the

value 'n'. Check these unsatisfied dependencies: SERIAL (=n), SERIAL_HAS_DRIVER (=n). See

docs.zephyrproject.org/.../CONFIG_UART_CONSOLE.html and/or look up

UART_CONSOLE 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.

warning: AT_CMD (defined at /Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/lib/at_cmd/Kconfig:9) has direct dependencies BSD_LIBRARY with value n, but is currently being y-selected by the following symbols:

- LTE_LINK_CONTROL (defined at /Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/lib/lte_link_control/Kconfig:7), with value y, direct dependencies y (value: y)

error: Aborting due to Kconfig warnings

CMake Error at /Users/paul_tanner/Nordic/nrfsrc/ncs/zephyr/cmake/kconfig.cmake:239 (message):

  command failed with return code: 1

Call Stack (most recent call first):

  /Users/paul_tanner/Nordic/nrfsrc/ncs/zephyr/cmake/app/boilerplate.cmake:591 (include)

  /Users/paul_tanner/Nordic/nrfsrc/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)

  /Users/paul_tanner/Nordic/nrfsrc/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)

  CMakeLists.txt:11 (find_package)

-- Configuring incomplete, errors occurred!

FATAL ERROR: command exited with status 1: /usr/local/bin/cmake -DWEST_PYTHON=/usr/local/opt/python/bin/python3.7 -B/Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/samples/nrf9160/udp/build -S/Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/samples/nrf9160/udp -GNinja -DBOARD=nrf9160dk_nrf9160

Also tried 

west build -b nrf9160dk_nrf9160ns -p

which seems to build cleanly.  when running this we get 

*** Booting Zephyr OS build v2.4.0-ncs1  ***


Flash regions	
Domain
Permissions


00 00 0x00000 0x08000 	
Secure
rwxl


01 31 0x08000 0x100000 
Non-Secure
rwxl

Non-secure callable region 0 placed in flash region 0 with size 32.




SRAM region
Domain
Permissions


00 07 0x00000 0x10000 
Secure
rwxl


08 31 0x10000 0x40000 
Non-Secure
rwxl




Peripheral
Domain
Status


00 NRF_P0               Non-Secure
OK


01 NRF_CLOCK            Non-Secure
OK


02 NRF_RTC0             Non-Secure
OK


03 NRF_RTC1             Non-Secure
OK


04 NRF_NVMC             Non-Secure
OK

05 NRF_UARTE1           Non-Secure
OK


06 NRF_UARTE2           Secure
SKIP


07 NRF_TWIM2            Non-Secure
OK


08 NRF_SPIM3            Non-Secure
OK


09 NRF_TIMER0           Non-Secure
OK

10 NRF_TIMER1           Non-Secure
OK


11 NRF_TIMER2           Non-Secure
OK


12 NRF_SAADC            Non-Secure
OK


13 NRF_PWM0             Non-Secure
OK


14 NRF_PWM1             Non-Secure
OK

15 NRF_PWM2             Non-Secure
OK


16 NRF_PWM3             Non-Secure
OK


17 NRF_WDT              Non-Secure
OK


18 NRF_IPC              Non-Secure
OK


19 NRF_VMC              Non-Secure
OK


20 NRF_FPU              Non-Secure
OK


21 NRF_EGU1             Non-Secure
OK


22 NRF_EGU2             Non-Secure
OK


23 NRF_DPPIC            Non-Secure
OK


24 NRF_GPIOTE1          Non-Secure
OK


25 NRF_REGULATORS       Non-Secure
OK




SPM: NS image at 0xc000

SPM: NS MSP at 0x200234a0


SPM: NS reset vector at 0xfaa1

SPM: prepare to jump to Non-Secure image.

and then it stalls

Any suggestions please.

  • Maybe I need to register the iBasis SIM that comes with the 9160DK?

    And maybe the coverage on iBasis is too limited.

    I've ordered Vodafore SIMs.

  • NCS document has a section about how to select and verify Network Mode. You can add CONFIG_LTE_NETWORK_MODE_NBIOT=y and CONFIG_LTE_NETWORK_MODE_LTE_M=n to prj.conf, or change through menuconfig. IBasis have LTE-M coverage in most countries, but NB-IoT is less supported, you can check this IBasis coverage page, so confirm and check with a local operator seems more promised.

  • Thx Charlie,

    I think the iBasis looks like a non-starter as even LTE/M has limited coverage in the UK but they do not give any kind of coverage map.  Testing without knowing about coverage is probably a waste of time.

    I believe that Vodafone have some NB-IoT coverage in the UK so I think we need one of their SIMs. 

  • correction: after a long time it did come back with something:

    ```

    The MQTT simple sample startedLTE Link Connecting ...
    +CEREG: 2,"0530","07D70478",7,0,0,"11100000","11100000"
    +CSCON: 1+CEREG: 2,"0530","07D70478",7,0,19,"11100000","11100000"
    +CSCON: 0+CEREG: 0,"0530","07D70478",7,0,19,"11100000","11100000"
    +CEREG: 2,"FFFE","FFFFFFFF",9,0,19,"11100000","11100000
    "LTE Link Connected!
    ERROR: getaddrinfo failed -11

    ```

    My Kconfig:

    ```

    #
    # Copyright (c) 2020 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    #

    menu "MQTT simple sample"
    config MQTT_PUB_TOPIC
    string "MQTT publish topic"
    default "my/publish/topic"

    config MQTT_SUB_TOPIC
    string "MQTT subscribe topic"
    default "my/subscribe/topic"

    config MQTT_CLIENT_ID
    string "MQTT Client ID"
    default "devzone_client"

    config MQTT_BROKER_HOSTNAME
    string "MQTT broker hostname"
    default "test.mosqitto.org" #"mqtt.eclipse.org"

    config MQTT_BROKER_PORT
    int "MQTT broker port"
    default 8884 #1883

    config MQTT_MESSAGE_BUFFER_SIZE
    int "MQTT message buffer size"
    default 128

    config MQTT_PAYLOAD_BUFFER_SIZE
    int "MQTT payload buffer size"
    default 128

    config MQTT_TLS_SEC_TAG
    int "TLS credentials security tag"
    default 16842753 #24

    config MQTT_TLS_SESSION_CACHING
    bool "Enable TLS session caching"

    config MQTT_TLS_PEER_VERIFY
    int "Set peer verification level"
    default 1 #2
    help
    Set to 0 for VERIFY_NONE, 1 for VERIFY_OPTIONAL, and 2 for
    VERIFY_REQUIRED.

    endmenu

    menu "Zephyr Kernel"
    source "Kconfig.zephyr"
    endmenu

    ```

    BTW. should "config MQTT_BROKER_HOSTNAME"  be written as

    "CONFIG_MQTT_BROKER_HOSTNAME"

  • I just got an answer from iBasis about this.  The LTE/M coverage map https://www.o2.co.uk/business/iot/lte-m shows that we are in range.  However they also say "if you are in the coverage range, please also make sure that you register and activate the card on the Nordic nRF Cloud before it can be used.".  I kind of expected this but still didn't know how to do it.  I found this https://nrfcloud.com/ and tried to create an account.  Suspiciously slow.  Is this for real?

Related