Setting up the development environment for older SDKs in 2024

Hi, 

We have recently acquired a new firmware engineer, and would like to get him set up with a development environment for developing code for our product. The problem is, we were early adopters of the nRF9160, and we are still using SDK 1.6.1. Now I know whenever I ask a question about something I often get the response that I need to update the SDK version - but we have had nightmares trying to do that. Our new engineer was going to be tasked with giving that a go, but it would certainly help if he could get the current environment set up on his machine. 

He has tried getting it setup, and I have had a go on another computer. Both computers were on Windows 11, so we presumed there maybe a problem with that. We set up a virtual machine with Windows 10 on his machine, and again, we ran into the same problem. It seems it cannot include the prj.conf file in the build. We always get  - Kconfig Errno 22

Something is definitely not right in the setup of the SDK. We have tried it multiple ways

1. nRF Connect for Desktop - Toolchain Manager - download and install v1.6.1 - open VS Code - make new project from sample

2. Download SDK from VS Code nRF Connect Extension - 1.6.1 - make new project from sample

3. Copy the SDK from the folder on my computer, put on new machine - make new project from sample

We both have the same version of the nRF Extension and VS Code. 

In every scenario, we get the same error in the problems tab on VS Code. If we manually build with a west command we can get it building, but it still seems to ignore some/all of the project configuration file. In the last attempt, we found that it built fine, did not show any errors on the terminal (still there on problems tab), but when it came to debugging, we could tell the config options had not been used. 

I know this stuff is very complicated in the background so I don't expect you to be able to debug this from what I have said, however, what would be good, is if someone could verify that if they use a clean PC, they can download and install SDK v1.6.1 and build a sample application - we keep using the UDP sample, as our code started with that.

Thanks in advance. 

Damien

Parents
  • Hi Damien,

    DamoL said:
    I am also not sure how we are meant to keep up with the SDK releases. When 1.7.0 was released, I could not find a simple way to port code I had written in 1.6.1, as simple things like project configuration names had been changed, and libraries for things we used just disappeared. That was one release apart, and you seemingly release a new SDK every 8-10 weeks so I honestly don't know how we are meant to stay up to date.

    There’s no need to migrate if you’re satisfied with your existing solution. However, for NCS porting, we’ve introduced Migration Guides based on customer feedback. Alongside the release notes, these guides help customers stay informed about updates and migrate their code accordingly. Unfortunately, these guides are only available starting from NCS 2.0.0. You can find them from Releases and maturity page of each NCS version document.

    NCS follows a quarterly release cycle to provide regular bug fixes and feature improvements. While this ensures rapid enhancements, we understand it can be challenging for developers to keep pace with frequent updates. We’re actively exploring ways to strike a better balance, and the update frequency may slow down in the future.

    DamoL said:
    However we are where we are, and we don't have much chance of our new guy being able to help remake our firmware on an updated SDK without him able to build the current one and understand how it works, so if you could please assist us with getting an environment set up, that would be great. 

    We will continue to support the older versions of NCS as long as there are developers still using them.

    I tested NCS 1.6.1 on a Windows 10 PC. Here’s the process I followed:

    1. Install NCS 1.6.1 with nRF Connect for Desktop->Toolchain Manager

    2. According to NCS 1.6.1 document page Building and programming a sample application, only SES and command line were supported since VS code extneions were not exist at that time, so I build with command line form Toolchain Manager-> nRF Connect SDK v1.6.1->Open command prompt

    C:\nordic\v1.6.1\nrf\samples\nrf9160\udp>west build  -p -b nrf9160dk_nrf9160ns -- [email protected]
    -- west build: making build dir C:\nordic\v1.6.1\nrf\samples\nrf9160\udp\build pristine
    -- west build: generating a build system
    Including boilerplate (Zephyr base): C:/nordic/v1.6.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/nordic/v1.6.1/nrf/samples/nrf9160/udp
    -- Using NCS Toolchain 1.6.1 for building. (C:/nordic/v1.6.1/toolchain/cmake)
    -- Zephyr version: 2.6.0-rc1 (C:/nordic/v1.6.1/zephyr), build: v2.6.0-rc1-ncs1
    -- Found Python3: C:/nordic/v1.6.1/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
    -- Found west (found suitable version "0.11.0", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160ns, Revision: 0.9.0 (Active: 0.7.0)
    -- Cache files will be written to: C:/nordic/v1.6.1/zephyr/.cache
    -- Found dtc: C:/nordic/v1.6.1/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/nordic/v1.6.1/toolchain/opt)
    -- Found BOARD.dts: C:/nordic/v1.6.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns.dts
    -- Generated zephyr.dts: C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/zephyr/include/generated/device_extern.h
    
    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
    http://docs.zephyrproject.org/latest/reference/kconfig/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.
    
    Parsing C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/Kconfig
    Loaded configuration 'C:/nordic/v1.6.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns_defconfig'
    Merged configuration 'C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/prj.conf'
    Configuration saved to 'C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/zephyr/.config'
    Kconfig header saved to 'C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/nordic/v1.6.1/toolchain/opt/bin/arm-none-eabi-gcc.exe
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image spm -  begin ===
    Including boilerplate (Zephyr base): C:/nordic/v1.6.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/nordic/v1.6.1/nrf/samples/spm
    -- Using NCS Toolchain 1.6.1 for building. (C:/nordic/v1.6.1/toolchain/cmake)
    -- Zephyr version: 2.6.0-rc1 (C:/nordic/v1.6.1/zephyr), build: v2.6.0-rc1-ncs1
    -- Found Python3: C:/nordic/v1.6.1/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
    -- Found west (found suitable version "0.11.0", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: C:/nordic/v1.6.1/zephyr/.cache
    -- Found dtc: C:/nordic/v1.6.1/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/nordic/v1.6.1/toolchain/opt)
    -- Found BOARD.dts: C:/nordic/v1.6.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Found devicetree overlay: C:/nordic/v1.6.1/nrf/samples/spm/nrf9160dk_nrf9160.overlay
    -- Generated zephyr.dts: C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/spm/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/spm/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/spm/zephyr/include/generated/device_extern.h
    
    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
    http://docs.zephyrproject.org/latest/reference/kconfig/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.
    
    Parsing C:/nordic/v1.6.1/zephyr/Kconfig
    Loaded configuration 'C:/nordic/v1.6.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
    Merged configuration 'C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/child_image/spm/prj.conf'
    Merged configuration 'C:/nordic/v1.6.1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/spm/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/spm/zephyr/.config'
    Kconfig header saved to 'C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/spm/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/nordic/v1.6.1/toolchain/opt/bin/arm-none-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build/spm
    === child image spm -  end ===
    
    CMake Warning at C:/nordic/v1.6.1/zephyr/CMakeLists.txt:1607 (message):
      __ASSERT() statements are globally ENABLED
    
    
    Dropping partition 'nrf_modem_lib_trace' since its size is 0.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/nordic/v1.6.1/nrf/samples/nrf9160/udp/build
    -- west build: building application
    [5/176] Performing build step for 'spm_subimage'
    [201/208] Linking C executable zephyr\zephyr_prebuilt.elf
    
    [208/208] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:         32 KB        64 KB     50.00%
                SRAM:       10328 B        64 KB     15.76%
            IDT_LIST:          0 GB         2 KB      0.00%
    [168/176] Linking C executable zephyr\zephyr_prebuilt.elf
    
    [175/176] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       89368 B       960 KB      9.09%
                SRAM:       19280 B     178968 B     10.77%
            IDT_LIST:          0 GB         2 KB      0.00%
    [176/176] Generating zephyr/merged.hex
    

    3. Comparing nrf\samples\nrf9160\udp\prj.conf and nrf\samples\nrf9160\udp\build\zephyr\.config, I confimred the configuration from prj.conf is actually used by buliding in .config.

    For the issue that some/all of the project configuration file not used by building process, I suggest you use "-p" to do pristine building, or just simply delete build folder and rebuild the whole prject.

    Best regards,

    Charlie

  • Hi Charlie, thanks for the quick response. 

    When I first started using the nRF9160, VS code was definitely supported. When you downloaded the SDK, there was a button that checked all the extensions you had on VS Code and it would prompt you to install them on VS Code if any were missing. V1.6.1 was the latest at the time, for sure, that why I went with it. There was a Youtube video showing this on this SDK at the time that I followed - looks like that video has been updated now. 

    Can I also check how the build command would work if the sample was copied to a different location, rather than building in that sample folder? I wondered if it was something to do with build files not referencing the correct west or CMAKE directory, or just something missing - there is also a lot of environment variables that could be wrong I guess, but that's tricky to debug as they seem to exist all over the SDK folder

    Regarding deleting build folders and building pristine - trust me, we have done that hundreds of times. 

    The point still stands that we need to get this in VS Code too, difficult to debug and step through code without an IDE. 

    Thanks, 

    Damien

  • Hi Damien,

    DamoL said:
    Can I also check how the build command would work if the sample was copied to a different location, rather than building in that sample folder?

    The folder location does not affect the build process, as the building configuration determines where to locate the resources required for a project.

    nRF Connect Extension for VS Code has a update recently that allows developers to choose the version of the nRF Connect SDK and toolchain they wish to use.

    I downloaded the NCS v1.6.1 toolchain and NCS with the latest nRF Connect Extension for VS code. The installation is located in C:\ncs\v1.6.1.

    For testing, I copied the C:\ncs\v1.6.1\nrf\samples\nrf9160\udp sample project to C:/udp.

    I built both versions of the udp project using the following configuration, and both builds completed successfully without issues.

      

    Below is the log showing the build and programming process captured from the nRF Terminal when build C:/udp:

     *  Executing task: nRF Connect: Generate config nrf9160dk_nrf9160ns for c:\udp 
    
    Building udp
    C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir c:/udp/build c:/udp --pristine --board nrf9160dk_nrf9160ns -- -DNCS_TOOLCHAIN_VERSION=NONE"
    
    -- west build: generating a build system
    Including boilerplate (Zephyr base): C:/ncs/v1.6.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/udp
    -- Zephyr version: 2.6.0-rc1 (C:/ncs/v1.6.1/zephyr), build: v2.6.0-rc1-ncs1
    -- Found Python3: C:/ncs/toolchains/v1.6.1/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.11.0", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160ns, Revision: 0.7.0
    -- Cache files will be written to: C:/ncs/v1.6.1/zephyr/.cache
    -- Found dtc: C:/ncs/toolchains/v1.6.1/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (c:/ncs/toolchains/v1.6.1/opt)
    -- Found BOARD.dts: C:/ncs/v1.6.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns.dts
    -- Generated zephyr.dts: C:/udp/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/udp/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/udp/build/zephyr/include/generated/device_extern.h
    
    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
    http://docs.zephyrproject.org/latest/reference/kconfig/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.
    
    Parsing C:/udp/Kconfig
    Loaded configuration 'C:/ncs/v1.6.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns_defconfig'
    Merged configuration 'C:/udp/prj.conf'
    Configuration saved to 'C:/udp/build/zephyr/.config'
    Kconfig header saved to 'C:/udp/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/v1.6.1/opt/bin/arm-none-eabi-gcc.exe
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image spm -  begin ===
    Including boilerplate (Zephyr base): C:/ncs/v1.6.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/ncs/v1.6.1/nrf/samples/spm
    -- Zephyr version: 2.6.0-rc1 (C:/ncs/v1.6.1/zephyr), build: v2.6.0-rc1-ncs1
    -- Found Python3: C:/ncs/toolchains/v1.6.1/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.11.0", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: C:/ncs/v1.6.1/zephyr/.cache
    -- Found dtc: C:/ncs/toolchains/v1.6.1/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/ncs/toolchains/v1.6.1/opt)
    -- Found BOARD.dts: C:/ncs/v1.6.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Found devicetree overlay: C:/ncs/v1.6.1/nrf/samples/spm/nrf9160dk_nrf9160.overlay
    -- Generated zephyr.dts: C:/udp/build/spm/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/udp/build/spm/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/udp/build/spm/zephyr/include/generated/device_extern.h
    
    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
    http://docs.zephyrproject.org/latest/reference/kconfig/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.
    
    Parsing C:/ncs/v1.6.1/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.6.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
    Merged configuration 'C:/udp/child_image/spm/prj.conf'
    Merged configuration 'C:/ncs/v1.6.1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/udp/build/spm/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/udp/build/spm/zephyr/.config'
    Kconfig header saved to 'C:/udp/build/spm/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/v1.6.1/opt/bin/arm-none-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/udp/build/spm
    === child image spm -  end ===
    
    CMake Warning at C:/ncs/v1.6.1/zephyr/CMakeLists.txt:1607 (message):
      __ASSERT() statements are globally ENABLED
    
    
    Dropping partition 'nrf_modem_lib_trace' since its size is 0.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/udp/build
    -- west build: building application
    [201/208] Linking C executable zephyr\zephyr_prebuilt.elf
    
    [208/208] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:         32 KB        64 KB     50.00%
                SRAM:       10328 B        64 KB     15.76%
            IDT_LIST:          0 GB         2 KB      0.00%
    [168/176] Linking C executable zephyr\zephyr_prebuilt.elf
    
    [175/176] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       89368 B       960 KB      9.09%
                SRAM:       19280 B     178968 B     10.77%
            IDT_LIST:          0 GB         2 KB      0.00%
    [176/176] Generating zephyr/merged.hex
     *  Terminal will be reused by tasks, press any key to close it. 
    
     *  Executing task: nRF Connect: Build: udp/build (active) 
    
    Building udp
    C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir c:/udp/build c:/udp"
    
    [0/11] Performing build step for 'spm_subimage'
    ninja: no work to do.
     *  Terminal will be reused by tasks, press any key to close it. 
    
     *  Executing task: nRF Connect: Flash: udp/build (active) 
    
    Flashing build to 960014628
    C:\WINDOWS\system32\cmd.exe /d /s /c "west flash -d c:\udp\build --skip-rebuild --snr 960014628 --erase"
    
    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: mass erase requested
    -- runners.nrfjprog: Flashing file: C:\udp\build\zephyr\merged.hex
    [ #################### ]   0.365s | Erase file - Done erasing                                                          
    [ #################### ]   0.883s | Program file - Done programming                                                    
    WARNING: A programming operation has been performed without --verify.
    WARNING: Programming can fail without error.
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 960014628 flashed successfully.
     *  Terminal will be reused by tasks, press any key to close it. 

    I am still using a Win10 PC. It would be good if you can have a try like I did to see the previouse problem still exist.

    Best regards,

    Charlie

  • Hi Charlie, 

    Thank you. My colleague did exactly what you did by building via command line, and it build successfully. We then opened that sample in VS Code and it recognised the build, we were able to debug it, and build it again in VS Code with the extension. However, in the problems tab within VS Code it still complained about not being able to find Kconfig file, that definitely exists in the path it's looking in. (Kconfig Errno 22). So I assume it must be something to do with VS Code/Extensions

Reply
  • Hi Charlie, 

    Thank you. My colleague did exactly what you did by building via command line, and it build successfully. We then opened that sample in VS Code and it recognised the build, we were able to debug it, and build it again in VS Code with the extension. However, in the problems tab within VS Code it still complained about not being able to find Kconfig file, that definitely exists in the path it's looking in. (Kconfig Errno 22). So I assume it must be something to do with VS Code/Extensions

Children
No Data
Related