platformio / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
9 stars 11 forks source link

Cmake errors in framework-zephyr for stm32, which is fixed after clearing the cache #5

Closed azeemshatp closed 3 years ago

azeemshatp commented 3 years ago

What kind of issue is this?


Configuration

Operating system: Windows 10

PlatformIO Version (platformio --version): PlatformIO, version 4.3.4

Description of problem

CMake errors while using different ststm32 platforms and framework-zephyr. PIO gives errors whereas west build works fine.

Steps to Reproduce

  1. I have an STM32 based project running on Zephyr that compiles fine with the latest PIO (having Zephyr 2.3.0). I have selected the below in the platformio.ini file. platform = ststm32@~7.1.1

  2. Now if I try to compile an older project in PIO that uses the below settings in the platformio.ini file, platform = ststm32@~6.1.0 ( I think )

  3. PIO throws the below errors
    -- The C compiler identification is GNU 8.2.1 -- The CXX compiler identification is GNU 8.2.1 -- The ASM compiler identification is GNU -- Found assembler: C:/Users/xxx/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc.exe -- Cache files will be written to: C:/Users/xxx/.platformio/packages/framework-zephyr/.cache -- Could NOT find Git (missing: GIT_EXECUTABLE) -- Configuring incomplete, errors occurred! See also "C:/Users/xxx/yyy/node-firmware-stm32/.pio/build/sb-0v3/CMakeFiles/CMakeOutput.log". See also "C:/Users/xxx/yyy/node-firmware-stm32/.pio/build/sb-0v3/CMakeFiles/CMakeError.log".

    Including boilerplate (Zephyr base): C:/Users/xxx/.platformio/packages/framework-zephyr/cmake/app/boilerplate.cmake Python path: C:/Users/xxx/.platformio/penv/Scripts/python.exe CMake Error at C:/Users/xxx/.platformio/packages/framework-zephyr/cmake/extensions.cmake:372 (add_library): The target name "..framework-zephyr-hal-stm32@0.0.0-alpha+sha.d1bc80d021stm32cube" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. Call Stack (most recent call first): C:/Users/xxx/.platformio/packages/framework-zephyr/cmake/extensions.cmake:349 (zephyr_library_named) C:/Users/xxx/.platformio/packages/framework-zephyr-hal-stm32@0.0.0-alpha+sha.d1bc80d021/stm32cube/CMakeLists.txt:9 (zephyr_library)

    CMake Error at C:/Users/xxx/.platformio/packages/framework-zephyr/cmake/extensions.cmake:416 (target_sources): Cannot specify sources for target "..framework-zephyr-hal-stm32@0.0.0-alpha+sha.d1bc80d021stm32cube" which is not built by this project. Call Stack (most recent call first): C:/Users/xxx/.platformio/packages/framework-zephyr-hal-stm32@0.0.0-alpha+sha.d1bc80d021/stm32cube/stm32l0xx/CMakeLists.txt:5 (zephyr_library_sources)

  4. Now if I go back and if try to compile the previously compiling code, it gets the same error too.

  5. In order to make this work this, you have to manually delete some folders such as

    • framework-zephyr-hal-stm32@0.0.0-alpha+sha.d1bc80d021
    • framework-zephyr
    • framework-zephyr-hal-stm32

If problems with PlatformIO Build System:

The content of platformio.ini:

# ststm32 platform release 7.1.1 includes Zephyr 2.3.0
#platform = https://github.com/platformio/platform-ststm32.git
platform = ststm32@~7.1.1

framework = zephyr

upload_protocol = stlink

# Custom Serial Monitor baud rate
monitor_speed = 115200
valeros commented 3 years ago

Hi @azeemshatp ! Should be fixed in the latest zephyr package. Please run pio platform update ststm32

martinjaeger commented 3 years ago

Thanks @valeros. I tested it and can confirm that the issue described by @azeemshatp is solved.

valeros commented 3 years ago

Thanks for the confirmation!