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

Unable to Configure SPI 1 with nrf9160ns setting

I am integrating a sensor on SPI 1 with cellular but device get stuck in CPU idle when first transaction of SPI is made?

I am using nrf9160dk_nrf9160ns as board configuration and CONFIG_SPI and CONFIG_SPI_1 is enabled in project configuration.

I am facing something similar with I2C 1 too. (not using both peripherals at once).

Is there something to do with secure and non secure peripherals.

Any help is appreciated.

Thanks

Parents
  • Hi,

     

    This could be because of secure region (SPM) enabling the serial drivers uart0 and uart1.

    Could you try to add this to the CMakeLists.txt file (just below the cmake_minimum_required(..) line):

    if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/spm.conf")
      set(spm_CONF_FILE
        prj.conf
        ${CMAKE_CURRENT_LIST_DIR}/spm.conf
      )
    endif()
    
    if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf")
      set(mcuboot_CONF_FILE
        prj.conf
        ${CMAKE_CURRENT_LIST_DIR}/mcuboot.conf
      )
    endif()
    
    if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${BOARD}.overlay")
      set(mcuboot_DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${BOARD}.overlay")
    endif()

     

    Then you create a $(BOARD).overlay (nrf9160dk_nrf9160ns.overlay in this case) file holding:

    &uart1 {
        status = "disabled";
    };
    
    /* rest of your overlay configurations here */

     

    You can also create a file "spm.conf" where you can disable serial if you'd like:

    CONFIG_SERIAL=n

    You typically want this to enter idle mode with low power consumption.

     

    Kind regards,

    Håkon

  • Hi Håkon,

    Thanks for the help. This update has solved the problem.

    Best Regards

Reply Children
Related