Firmware compilation error

compile mbed success;
compile zephyr erreor.

Executing task: C:\Users\han.platformio\penv\Scripts\pio.exe run <

Processing mppt_2420_lc (board: mppt_2420_lc; platform: ststm32@~8.1.0; framework: zephyr)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/mppt_2420_lc.html
PLATFORM: ST STM32 (8.1.0) > Libre Solar MPPT 2420 LC
HARDWARE: STM32F072RBT6 48MHz, 16KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, jlink)
PACKAGES:

  • framework-zephyr 2.20400.0+sha.4cb433d
  • framework-zephyr-canopennode 0.0.0-alpha+sha.5c6b0566d5
  • framework-zephyr-civetweb 0.0.0-alpha+sha.99129c5efc
  • framework-zephyr-cmsis 0.0.0-alpha+sha.542b2296e6
  • framework-zephyr-fatfs 0.0.0-alpha+sha.9ee6b9b951
  • framework-zephyr-hal-st 0.0.0-alpha+sha.5b3ec3e182
  • framework-zephyr-hal-stm32 0.0.0-alpha+sha.d1bc80d021
  • framework-zephyr-libmetal 0.0.0-alpha+sha.3c3c9ec83b
  • framework-zephyr-littlefs 0.0.0-alpha+sha.0aefdda69d
  • framework-zephyr-loramac-node 0.0.0-alpha+sha.29e516ec58
  • framework-zephyr-lvgl 0.0.0-alpha+sha.74fc2e753a
  • framework-zephyr-mbedtls 0.0.0-alpha+sha.4bf099f125
  • framework-zephyr-mcuboot 0.0.0-alpha+sha.e88113bbeb
  • framework-zephyr-mcumgr 0.0.0-alpha+sha.5885efb7ca
  • framework-zephyr-mipi-sys-t 0.0.0-alpha+sha.957d46bc3c
  • framework-zephyr-open-amp 0.0.0-alpha+sha.724f7e2a45
  • framework-zephyr-openthread 0.0.0-alpha+sha.a83d18cf18
  • framework-zephyr-segger 0.0.0-alpha+sha.6fcf61606d
  • framework-zephyr-tinycbor 0.0.0-alpha+sha.40daca97b4
  • framework-zephyr-tinycrypt 0.0.0-alpha+sha.3e9a49d267
  • framework-zephyr-trusted-firmware-m 0.0.0-alpha+sha.7de2daa196
  • tool-cmake 3.16.4
  • tool-dtc 1.4.7
  • tool-ninja 1.9.0
  • toolchain-gccarmnoneeabi 1.80201.190214 (8.2.1)
    Reading CMake configuration…
    – Application: D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/zephyr
    – Zephyr version: 2.4.0 (C:/Users/han/.platformio/packages/framework-zephyr)
    – Found Python3: C:/Users/han/.platformio/penv/Scripts/python.exe (found suitable exact version “3.7.7”) found components: Interpreter
    – Board: mppt_2420_lc
    – Cache files will be written to: C:/Users/han/.platformio/packages/framework-zephyr/.cache
    – Found dtc: C:/Users/han/.platformio/packages/tool-dtc/dtc.exe (found suitable version “1.4.7”, minimum required is “1.4.6”)
    – Found toolchain: gnuarmemb (C:/Users/han/.platformio/packages/toolchain-gccarmnoneeabi)
    – Found BOARD.dts: D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/boards/arm/mppt_2420_lc/mppt_2420_lc.dts
    – Generated zephyr.dts: D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/.pio/build/mppt_2420_lc/zephyr/zephyr.dts
    – Generated devicetree_unfixed.h: D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/.pio/build/mppt_2420_lc/zephyr/include/generated/devicetree_unfixed.h
    Parsing D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/zephyr/Kconfig

Loaded configuration ‘D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/boards/arm/mppt_2420_lc/mppt_2420_lc_defconfig’

Merged configuration ‘D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/zephyr/prj.conf’

Configuration saved to ‘D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/.pio/build/mppt_2420_lc/zephyr/.config’

Kconfig header saved to ‘D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/.pio/build/mppt_2420_lc/zephyr/include/generated/autoconf.h’

– 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/han/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc.exe
– Could NOT find Git (missing: GIT_EXECUTABLE)
– Configuring incomplete, errors occurred!
See also “D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/.pio/build/mppt_2420_lc/CMakeFiles/CMakeOutput.log”.
See also “D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/.pio/build/mppt_2420_lc/CMakeFiles/CMakeError.log”.

Including boilerplate (Zephyr base): C:/Users/han/.platformio/packages/framework-zephyr/cmake/app/boilerplate.cmake
CMake Error at C:/Users/han/.platformio/packages/framework-zephyr/cmake/extensions.cmake:398 (add_library):
The target name
“D:__HanHanWorkstation__Git__projects__charge-controller-firmware20210114__charge-controller-firmware__boards__arm__mppt_2420_lc”
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/han/.platformio/packages/framework-zephyr/cmake/extensions.cmake:375 (zephyr_library_named)
D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/boards/arm/mppt_2420_lc/CMakeLists.txt:4 (zephyr_library)

CMake Error at C:/Users/han/.platformio/packages/framework-zephyr/cmake/extensions.cmake:442 (target_sources):
Cannot specify sources for target
“D:__HanHanWorkstation__Git__projects__charge-controller-firmware20210114__charge-controller-firmware__boards__arm__mppt_2420_lc”
which is not built by this project.
Call Stack (most recent call first):
D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/boards/arm/mppt_2420_lc/CMakeLists.txt:5 (zephyr_library_sources)

CMake Error at C:/Users/han/.platformio/packages/framework-zephyr/cmake/extensions.cmake:446 (target_include_directories):
Cannot specify include directories for target
“D:__HanHanWorkstation__Git__projects__charge-controller-firmware20210114__charge-controller-firmware__boards__arm__mppt_2420_lc”
which is not built by this project.
Call Stack (most recent call first):
D:/HanHanWorkstation/Git/projects/charge-controller-firmware20210114/charge-controller-firmware/boards/arm/mppt_2420_lc/CMakeLists.txt:6 (zephyr_library_include_directories)

============================================================================================ [FAILED] Took 16.65 seconds ============================================================================================

Environment Status Duration


mppt_2420_lc FAILED 00:00:16.650
======================================================================================= 1 failed, 0 succeeded in 00:00:16.650 =======================================================================================
终端进程“C:\Users\han.platformio\penv\Scripts\pio.exe ‘run’”已终止,退出代码: 1。

Never seen that type of error. Suggestions how you could make it work:

  • Clone most recent version of the repository (remember to use recursive option as mentioned in the readme)
  • Delete .pio directory in the firmware directory and build again
  • Delete .platformio/packages/framework-zephyr in your home directory and build again
  • Try out develop branch (which contains newer version of Zephyr)

I’m wondering why you mentioned mbed, which is not supported anymore in the firmware. Did you use a very old version?

mbed suceess,the meaning is said that i compile the version of v19.0 success.
following your suggestion, i Clone most recent version,

  • Delete .pio directory in the firmware directory and build again
  • Delete .platformio/packages/framework-zephyr in your home directory and build again

but compile error again.
i wonder if the cmake had problem.

following your suggestion,Try out develop branch (which contains newer version of Zephyr)
i find that complile success at the version of Zephyr 2.5 ,complile error at the version of Zephyr 2.4.
thank you very much.

Ok, sounds good. Be aware that the develop branch is unstable (Zephyr v2.5 was not even released yet). I also just found out that the half bridge driver doesn’t seem to work, still need to find the error.

i also have a problem.
why default_ens has no mppt_2420_hc selection?

Just because I forgot to add it.