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

Parents
  • 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

  • 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

  • Hi Simon,

    I only build in SES and the project is building and running fine now. All I have done is get rid of the .overlay file and delete all files from the build folder. Your colleague Heidi has identified a problem in the .overlay file. I think other than the .overlay, I was not doing anything wrong.

    But why would an .overlay file cause a project not to load? I'd understand if it caused a build to fail.

    I would also like you to answer the question I asked 9 days ago and that is,

    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

    Mohamed

  • I see that you are building your projects from C:/zephyrproject/zephyr, and I assume you have gotten this from https://docs.zephyrproject.org/latest/getting_started/index.html#get-zephyr-and-install-python-dependencies. Am I right? You should not do this. The tutorial was written using NCS v1.3.0 and you should use that, not Zephyr upstream.

    Where it's coming from

    It seems like the first line ("Zephyr version: 2.3.99 (C:/zephyrproject/zephyr)"), comes from C:/zephyrproject/zephyr. I think this is because you are in a Zephyr directory when building and it will automatically get the Zephyr version of this repo (try running git describe --tags from C:/zephyrproject/zephyr and you will probably see 2.3.99). 

    I'm actually not sure where the Zephyr base from the second line ("C:\gnuarm\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=zephyr-v2.3.0-2211-g9163da09d69d ..."), comes from. However I saw the same behaviour when I built the light controller from C:/zephyrproject/zephyr with cmd not from the Toolchain Manager, and without setting Zephyr Base. However, if you build it from cmd/Git Bash from the Toolchain Manager, you don't need to set the Zephyr base, as it is set by default.

    Solution

    • Open Git bash (or cmd) from the Toolchain Manager as described here
    • cd into C:\Dev\NCS_projects\light_controller
    • Run west build -b nrf5340pdk_nrf5340_cpuapp -d build_53app

    Best regards,

    Simon

Reply Children
No Data
Related