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

nRF9160 at_client sample project

After much work I can build the nRF9160 at_client sample project and flash it into the development kit. Using nRF Connect, the at_client sample project  only prints the line "The AT host sample started" as per the source code (shouldn't this be "AT client sample started"?).  AT commands entered into nRF Connect timeout with no response.  Inspecting the file main.c of at_client and there is no code to read the UART and no code to parse AT commands.  I have flashed an at_client.hex file supplied by Nordic and that firmware does respond to AT commands.

Is something missing from the at_client sample project?  I would need to modify the firmware so that it can switch the UART to a data mode upon registration with the LTE data network. In order to do this I need access to the UART and AT command handlers. How do I get this and the source for the working at_client.hex file?

I'm evaluating the nRF9160 for a project and need confirmation that it can work.

Thanks

  • Can you please try to run the attached file?
    uicr_tcxo.hex

    nrfjprog.exe --program uicr_tcxo.hex -f nrf91 --sectorerase --verify

    Discussing the issue with my colleague, he mentioned that it could be an issue with the 32 MHz temperature compensated crystal oscillator (TCXO) register.

  • A sim card had been inserted and it worked with s Nordic supplied file at_client.hex.

    I erased flash then flashed file uicr_txco.hex, ran it, then flashed the built code. No AT commands.

    File prj.conf has the line CONFIG_AT_HOST_LIBRARY=y plus several other AT related lines. After a Clean Solution followed by Build Solution no AT* files are built.  See the attached build log.

    What is the search path for  modules referenced in prj.conf ?

    Building �zephyr/include/generated/driver-validation.h� from solution �build� in configuration �Common�
    1> Combining �zephyr/include/generated/driver-validation.h�
    Building �zephyr/CMakeFiles/driver_validation_h_target� from solution �build� in configuration �Common�
    Building �zephyr/driver_validation_h_target� from solution �build� in configuration �Common�
    Building �zephyr/include/generated/kobj-types-enum.h� from solution �build� in configuration �Common�
    1> Combining �zephyr/include/generated/kobj-types-enum.h�
    Building �zephyr/include/generated/otype-to-str.h� from solution �build� in configuration �Common�
    Building �zephyr/CMakeFiles/kobj_types_h_target� from solution �build� in configuration �Common�
    Building �zephyr/kobj_types_h_target� from solution �build� in configuration �Common�
    Building �zephyr/misc/generated/syscalls.json� from solution �build� in configuration �Common�
    1> Combining �zephyr/misc/generated/syscalls.json�
    Building �zephyr/include/generated/syscall_list.h� from solution �build� in configuration �Common�
    1> Combining �zephyr/include/generated/syscall_list.h�
    Building �zephyr/CMakeFiles/syscall_list_h_target� from solution �build� in configuration �Common�
    Building �zephyr/include/generated/syscall_dispatch.c� from solution �build� in configuration �Common�
    Building �zephyr/syscall_list_h_target� from solution �build� in configuration �Common�
    Building �zephyr/include/generated/syscall_macros.h� from solution �build� in configuration �Common�
    1> Combining �zephyr/include/generated/syscall_macros.h�
    Building �zephyr/CMakeFiles/syscall_macros_h_target� from solution �build� in configuration �Common�
    Building �zephyr/syscall_macros_h_target� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_offsets� from solution �build� in configuration �Common�
    Building �zephyr/offsets� from solution �build� in configuration �Common�
    1> Compiling �offsets.c�
    Building �zephyr/include/generated/offsets.h� from solution �build� in configuration �Common�
    1> Combining �zephyr/include/generated/offsets.h�
    Building �zephyr/CMakeFiles/offsets_h� from solution �build� in configuration �Common�
    Building �zephyr/offsets_h� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_app� from solution �build� in configuration �Common�
    Building �app/libapp.a� from solution �build� in configuration �Common�
    1> Compiling �main.c�
    Building �cmake_object_order_depends_target_zephyr� from solution �build� in configuration �Common�
    1> Archiving �libapp.a�
    Building �zephyr/libzephyr.a� from solution �build� in configuration �Common�
    1> Compiling �isr_tables.c�
    2> Compiling �sw_isr_common.c�
    3> Compiling �arm_core_cmse.c�
    4> Compiling �crc32_sw.c�
    4> Compiling �crc16_sw.c�
    1> Compiling �crc8_sw.c�
    2> Compiling �crc7_sw.c�
    3> Compiling �fdtable.c�
    1> Compiling �mempool.c�
    2> Compiling �rb.c�
    4> Compiling �thread_entry.c�
    3> Compiling �work_q.c�
    4> Compiling �printk.c�
    1> Compiling �assert.c�
    2> Compiling �configs.c�
    3> Compiling �soc.c�
    2> Compiling �mpu_regions.c�
    1> Compiling �system_nrf9160.c�
    4> Compiling �nrfx_glue.c�
    2> Compiling �socket_offload.c�
    1> Compiling �rand32_timer.c�
    3> Compiling �power.c�
    4> Compiling �policy_residency.c�
    2> Compiling �uart_console.c�
    1> Compiling �nrf_power_clock.c�
    3> Compiling �sys_clock_init.c�
    4> Compiling �nrf_rtc_timer.c�
    Building �cmake_object_order_depends_target_arch__arm__core� from solution �build� in configuration �Common�
    1> Archiving �libzephyr.a�
    Building �cmake_object_order_depends_target_arch__arm__core__cortex_m� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_arch__arm__core__cortex_m__mpu� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_drivers__gpio� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_drivers__serial� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_kernel� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_lib__libc__minimal� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_subsys__net� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_subsys__net__ip� from solution �build� in configuration �Common�
    Building �zephyr/linker.cmd� from solution �build� in configuration �Common�
    1> Combining �zephyr/linker.cmd�
    Building �zephyr/CMakeFiles/linker_script_target� from solution �build� in configuration �Common�
    Building �zephyr/linker_script_target� from solution �build� in configuration �Common�
    Building �cmake_object_order_depends_target_zephyr_prebuilt� from solution �build� in configuration �Common�
    Building �zephyr/arch/arm/core/libarch__arm__core.a� from solution �build� in configuration �Common�
    1> Assembling �swap_helper.S�
    2> Assembling �exc_exit.S�
    3> Assembling �cpu_idle.S�
    4> Assembling �fault_s.S�
    1> Assembling �isr_wrapper.S�
    2> Compiling �irq_init.c�
    3> Compiling �swap.c�
    4> Compiling �fault.c�
    1> Compiling �irq_manage.c�
    2> Compiling �thread.c�
    3> Compiling �fatal.c�
    4> Compiling �sys_fatal_error_handler.c�
    1> Compiling �thread_abort.c�
    Building �zephyr/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a� from solution �build� in configuration �Common�
    1> Archiving �libarch__arm__core.a�
    2> Assembling �vector_table.S�
    3> Assembling �reset.S�
    4> Assembling �nmi_on_reset.S�
    1> Compiling �prep_c.c�
    2> Compiling �scb.c�
    3> Compiling �nmi.c�
    4> Compiling �exc_manage.c�
    Building �zephyr/arch/arm/core/cortex_m/mpu/libarch__arm__core__cortex_m__mpu.a� from solution �build� in configuration �Common�
    1> Archiving �libarch__arm__core__cortex_m.a�
    2> Compiling �arm_core_mpu.c�
    3> Compiling �arm_mpu.c�
    Building �zephyr/lib/libc/minimal/liblib__libc__minimal.a� from solution �build� in configuration �Common�
    1> Archiving �libarch__arm__core__cortex_m__mpu.a�
    2> Compiling �atoi.c�
    3> Compiling �strtol.c�
    4> Compiling �strtoul.c�
    1> Compiling �malloc.c�
    2> Compiling �strncasecmp.c�
    3> Compiling �strstr.c�
    4> Compiling �string.c�
    1> Compiling �prf.c�
    3> Compiling �stdout_console.c�
    2> Compiling �sprintf.c�
    4> Compiling �fprintf.c�
    Building �zephyr/subsys/net/libsubsys__net.a� from solution �build� in configuration �Common�
    1> Archiving �liblib__libc__minimal.a�
    2> Compiling �buf.c�
    Building �zephyr/subsys/net/ip/libsubsys__net__ip.a� from solution �build� in configuration �Common�
    1> Archiving �libsubsys__net.a�
    2> Compiling �net_context.c�
    3> Compiling �net_core.c�
    4> Compiling �net_if.c�
    1> Compiling �net_pkt.c�
    3> Compiling �net_tc.c�
    1> Compiling �utils.c�
    2> Compiling �icmpv6.c�
    3> Compiling �nbr.c�
    2> Compiling �ipv6.c�
    4> Compiling �ipv6_nbr.c�
    1> Compiling �ipv6_mld.c�
    3> Compiling �route.c�
    2> Compiling �connection.c�
    1> Compiling �udp.c�
    Building �zephyr/drivers/gpio/libdrivers__gpio.a� from solution �build� in configuration �Common�
    1> Archiving �libsubsys__net__ip.a�
    2> Compiling �gpio_nrfx.c�
    Building �zephyr/drivers/serial/libdrivers__serial.a� from solution �build� in configuration �Common�
    1> Archiving �libdrivers__gpio.a�
    2> Compiling �uart_nrfx_uarte.c�
    Building �zephyr/kernel/libkernel.a� from solution �build� in configuration �Common�
    1> Archiving �libdrivers__serial.a�
    2> Compiling �device.c�
    3> Compiling �errno.c�
    4> Compiling �idle.c�
    1> Compiling �init.c�
    2> Compiling �mailbox.c�
    3> Compiling �mem_slab.c�
    4> Compiling �mempool.c�
    1> Compiling �msg_q.c�
    2> Compiling �mutex.c�
    3> Compiling �pipes.c�
    4> Compiling �queue.c�
    1> Compiling �sched.c�
    2> Compiling �sem.c�
    4> Compiling �stack.c�
    3> Compiling �system_work_q.c�
    2> Compiling �thread.c�
    4> Compiling �thread_abort.c�
    3> Compiling �version.c�
    1> Compiling �work_q.c�
    3> Compiling �smp.c�
    4> Compiling �timeout.c�
    2> Compiling �timer.c�
    3> Compiling �poll.c�
    1> Archiving �libkernel.a�
    Building �zephyr/zephyr_prebuilt.elf� from solution �build� in configuration �Common�
    1> Compiling �empty_file.c�
    1> Linking �zephyr_prebuilt.elf�
    1> Memory region         Used Size  Region Size  %age Used
    1>            FLASH:       49476 B         1 MB      4.72%
    1>             SRAM:       20084 B        64 KB     30.65%
    1>         IDT_LIST:          72 B         2 KB      3.52%
    Building �zephyr/linker_pass_final.cmd� from solution �build� in configuration �Common�
    1> Combining �zephyr/linker_pass_final.cmd�
    Building �zephyr/CMakeFiles/linker_pass_final_script_target� from solution �build� in configuration �Common�
    Building �zephyr/linker_pass_final_script_target� from solution �build� in configuration �Common�
    Building �zephyr/isr_tables.c� from solution �build� in configuration �Common�
    1> Combining �zephyr/isr_tables.c�
    Building �cmake_object_order_depends_target_kernel_elf� from solution �build� in configuration �Common�
    Building �zephyr/zephyr.elf� from solution �build� in configuration �Common�
    1> Compiling �empty_file.c�
    2> Compiling �isr_tables.c�
    1> Linking �zephyr.elf�
    1> Post-link command 
    Building �all� from solution �build� in configuration �Common�
    Build complete
    

  • Hello,

    A sim card had been inserted and it worked with s Nordic supplied file at_client.hex.

    Ok, that means that your board is working correctly and everything is as it should be. 

    I erased flash then flashed file uicr_txco.hex, ran it, then flashed the built code. No AT commands.

    Then we have excluded that issue. 

    File prj.conf has the line CONFIG_AT_HOST_LIBRARY=y plus several other AT related lines. After a Clean Solution followed by Build Solution no AT* files are built.  See the attached build log.

    I assume you are using Segger Embedded Studio due to "Clean Solution command", Therefore, I think we should move from using Segger Embedded Studio to building using command line instead, as there have been some issues with Segger Embedded Studio (that we are aware of) and the SDK. 


    Please follow this tutorial. Make sure to change the folder to \nrf\samples\nrf9160\at_client\ and delete the build folder.

    What is the search path for  modules referenced in prj.conf ?

    Have a look at this guide.

  • If  Segger Embedded Studio is not working correctly then it should be documented and corrected. When will it be corrected? Is much easier to debug code with the IDE.

    Can you provide step by step instructions for building for target nRD9160-DK via Window 10 command line?

    There is an error message on attempting to build:

    C:\Users\cwallach\Projects\Heart_Hero\LTE\ncs\nrf\samples\nrf9160\at_client\build>cmake -GNinja -DBOARD=nrf9160_pca10090 ..
    -- Using application from 'C:/Users/cwallach/Projects/Heart_Hero/LTE/ncs/nrf/samples/nrf9160/at_client'
    Zephyr version: 1.14.99
    -- Found PythonInterp: C:/Users/cwallach/AppData/Local/Programs/Python/Python37/python.exe (found suitable version "3.7.3", minimum required is "3.4")
    -- Selected BOARD nrf9160_pca10090
    -- Found west: C:/Users/cwallach/AppData/Local/Programs/Python/Python37/Scripts/west.exe (found suitable version "0.5.8", minimum required is "0.5.6")
    -- Cache files will be written to: C:\Users\cwallach\AppData\Local/.cache/zephyr
    CMake Error at C:/Users/cwallach/Projects/Heart_Hero/LTE/ncs/zephyr/cmake/generic_toolchain.cmake:57 (include):
      include could not find load file:
    
        C:/Users/cwallach/Projects/Heart_Hero/LTE/ncs/zephyr/cmake/toolchain/cgnuarmemb/generic.cmake
    Call Stack (most recent call first):
      C:/Users/cwallach/Projects/Heart_Hero/LTE/ncs/zephyr/cmake/app/boilerplate.cmake:446 (include)
      CMakeLists.txt:9 (include)
    
    
    -- Loading C:/Users/cwallach/Projects/Heart_Hero/LTE/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090.dts as base
    -- Overlaying C:/Users/cwallach/Projects/Heart_Hero/LTE/ncs/zephyr/dts/common/common.dts
    CMake Error at C:/Users/cwallach/Projects/Heart_Hero/LTE/ncs/zephyr/cmake/dts.cmake:131 (message):
      command failed with return code: The system cannot find the file specified
    Call Stack (most recent call first):
      C:/Users/cwallach/Projects/Heart_Hero/LTE/ncs/zephyr/cmake/app/boilerplate.cmake:493 (include)
      CMakeLists.txt:9 (include)
    
    
    -- Configuring incomplete, errors occurred!

    File LTE/ncs/zephyr/cmake/toolchain/cgnuarmemb/generic.cmake exists.

    Thanks

  • Hello,
    We are constantly working with SES and the master branch, some have it working, others have not. Do you have the latest Segger Embedded Studio (SES)?
    My colleague has SES working on Windows 10 here, please try this solution first and see if you can get that working.

    If the above does not work, we'll continue with command line. From the output you attached it seems that you have not configured the build environment correctly, see this link

    Kind regards,
    Øyvind
Related