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

I cannot load project in Segger Embedded Studio - emProject file is invalid

I am having problems loading an existing project that I successfully built and ran in the past.

I open IDE from nRF Connect > Toolchain Manager > Open IDE

The SES opens with the last project (different from the one I would like to load) running on the nRF5340pdk.

I then do File > Open nRF Connect SDK Project... > select the CMakeLists.txt for the project I want to load.

I get the error below. I then deleted all the files in the build folder but the error would not go away.

Any idea what could be causing this?

Thank you for your support.

Mohamed

Top Replies

  • Are you using the v1.3.0 version of the light controller sample? The tutorial has recently been updated. What happens if you build with west? Does it suceed then?

    Best regards,

    Simon

  • Hi Simon,

    Yes, I am using version v1.3.0.

    As I already said in my post, I successfully built and ran this project in SES very recently but I went back to it today it came back with that error. I prefer to work in SES if I can help it.

    I tried to build in west but it came back with this error.

    C:\zephyrproject\zephyr>west build -b nrf5340pdk_nrf5340_cpuapp C:\Dev\NCS_projects\light_controller --pristine
    -- west build: generating a build system
    Including boilerplate (Zephyr base): C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/Dev/NCS_projects/light_controller
    -- Zephyr version: 2.3.99 (C:/zephyrproject/zephyr)
    -- Found Python3: C:/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0/python3.8.exe (found suitable version "3.8.6", minimum required is "3.6") found components: Interpreter
    -- Found west: C:/Zypher/v1.3.0/toolchain/opt/bin/Scripts/west.exe (found suitable version "0.7.3", minimum required is "0.7.1")
    -- Board: nrf5340pdk_nrf5340_cpuapp
    -- Found toolchain: gnuarmemb (c:/gnuarm)
    -- Found BOARD.dts: C:/zephyrproject/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: C:/zephyrproject/zephyr/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/zephyrproject/zephyr/build/zephyr/include/generated/devicetree_unfixed.h
    Parsing C:/zephyrproject/zephyr/Kconfig
    Loaded configuration 'C:/zephyrproject/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuapp_defconfig'
    Merged configuration 'C:/Dev/NCS_projects/light_controller/prj.conf'
    Configuration saved to 'C:/zephyrproject/zephyr/build/zephyr/.config'
    Kconfig header saved to 'C:/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.3.1
    -- The CXX compiler identification is GNU 9.3.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/gnuarm/bin/arm-none-eabi-gcc.exe
    -- Cache files will be written to: C:/zephyrproject/zephyr/.cache
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/zephyrproject/zephyr/build
    -- west build: building application
    [10/133] Building C object CMakeFiles/app.dir/src/main.c.obj
    FAILED: CMakeFiles/app.dir/src/main.c.obj
    C:\gnuarm\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=zephyr-v2.3.0-2211-g9163da09d69d -DKERNEL -DNRF5340_XXAA_APPLICATION -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/zephyrproject/zephyr/include -Izephyr/include/generated -IC:/zephyrproject/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -IC:/zephyrproject/modules/hal/nordic/nrfx -IC:/zephyrproject/modules/hal/nordic/nrfx/drivers/include -IC:/zephyrproject/modules/hal/nordic/nrfx/mdk -IC:/zephyrproject/modules/hal/nordic/. -isystem C:/zephyrproject/zephyr/lib/libc/minimal/include -isystem c:/gnuarm/bin/../lib/gcc/arm-none-eabi/9.3.1/include -isystem c:/gnuarm/bin/../lib/gcc/arm-none-eabi/9.3.1/include-fixed -Os -imacrosC:/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m33 -mthumb -mabi=aapcs -imacrosC:/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-address-of-packed-member -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Dev/NCS_projects/light_controller=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles\app.dir\src\main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c C:/Dev/NCS_projects/light_controller/src/main.c
    C:/Dev/NCS_projects/light_controller/src/main.c:54:8: error: unknown type name 's16_t'
    54 | static s16_t m_sample_buffer[BUFFER_SIZE];
    | ^~~~~
    [23/133] Building C object zephyr/arch/arch/arm/core/aarch...keFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' --build 'C:\zephyrproject\zephyr\build'

    Thank you

    Mohamed

  • I see that you are not using a Zephyr version compatible with NCS v1.3.0. From the logs I see that you are using Zephyr version 2.3.99. The correct one should be v2.3.0-rc1-ncs1.

    If you have installed NCS manually, do this:

    cd <..>/nrf
    git pull
    git checkout v1.3.0
    west update #Comment: This will get the correct Zephyr version

    The easiest solution is to just install NCS v1.3.0 in the Toolchain Manager and open the git Bash shell directly from the Toolchain Manager, then everything is set up automatically.

    Best regards,

    Simon

  • Thank you Simon for your reply.

    I have rebooted my machine since my post and all seems to be fine now. I can successfully load project and build solution. How strange?

    I can see both v2.3.99 and v2.3.0 mentioned in the build log.

    -- Zephyr version: 2.3.99 (C:/zephyrproject/zephyr)

    C:\gnuarm\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=zephyr-v2.3.0-2211-g9163da09d69d ...

    What are these two lines telling us?

    Kind regards

  • Are you able to successfully build with west or SES?

    When you built with west, did you use the Git Bash from the Toolchain Manager?


    When you open SES from the Toolchain Manager, you should set the Board Directory field to point to a board from the Toolchain Manager Zephyr folder.

    Let me try to explain in another way:

    If you open SES Toolchain from Toolchain Manager NCS v1.3.0, you should choose the following Board Directory:

    C:\Users\<user name>\ncs\v1.3.0\zephyr\boards\arm\nrf5340pdk_nrf5340

    It did not seem like you did this in your initial post (given that you haven't changed the Toolchain Manager SDK directory).

    Best regards,

    Simon

Related