Hi,
I am using Verdin iMX8M with Dahlia Carrier Board and I’m trying to do a bare metal development for the Cortex-M4 Chip. I am using VSCode on Windows 11 for this purpose with all the recommended extensions installed from this guide. My goal is to be able to deploy and debug the code on the M-Chip over ARM-USB-OCD-H connector and OpenOCD. When I open one of the examples from the MCUXpresso SDK, the build is successfull using the build scripts provided (e.g. build_all.bat).
But when I try building through the VSCode I get the following error:
[main] Configuring folder: int_loopback_transfer
[driver] Removing c:/workspace/int_loopback_transfer/build/CMakeCache.txt
[driver] Removing c:\workspace\int_loopback_transfer\build\CMakeFiles
[proc] Executing command: "C:/Program Files/CMake/bin/cmake.exe" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug "-DCMAKE_C_COMPILER:FILEPATH=C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-g++.exe" -Sc:/workspace/int_loopback_transfer/armgcc -Bc:/workspace/int_loopback_transfer/build -G "MinGW Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The ASM compiler identification is GNU
[cmake] -- Found assembler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe
[cmake] -- The C compiler identification is GNU 10.3.1
[cmake] -- The CXX compiler identification is GNU 10.3.1
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - failed
[cmake] -- Check for working C compiler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe
[cmake] -- Check for working C compiler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe - broken
[cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:69 (message):
[cmake] The C compiler
[cmake]
[cmake] "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe"
[cmake]
[cmake] is not able to compile a simple test program.
[cmake]
[cmake] It fails with the following output:
[cmake]
[cmake] Change Dir: C:/workspace/int_loopback_transfer/build/CMakeFiles/CMakeTmp
[cmake]
[cmake] Run Build Command(s):C:/MinGW/bin/mingw32-make.exe -f Makefile cmTC_9a74a/fast && C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_9a74a.dir\build.make CMakeFiles/cmTC_9a74a.dir/build
[cmake] mingw32-make.exe[1]: Entering directory 'C:/workspace/int_loopback_transfer/build/CMakeFiles/CMakeTmp'
[cmake] Building C object CMakeFiles/cmTC_9a74a.dir/testCCompiler.c.obj
[cmake] C:\PROGRA~2\GNUARM~1\102021~1.10\bin\AR19DD~1.EXE -o CMakeFiles\cmTC_9a74a.dir\testCCompiler.c.obj -c C:\workspace\int_loopback_transfer\build\CMakeFiles\CMakeTmp\testCCompiler.c
[cmake] Linking C executable cmTC_9a74a
[cmake] "C:\Program Files\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_9a74a.dir\link.txt --verbose=1
[cmake] C:\PROGRA~2\GNUARM~1\102021~1.10\bin\AR19DD~1.EXE CMakeFiles/cmTC_9a74a.dir/testCCompiler.c.obj -o cmTC_9a74a
[cmake] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): in function `exit':
[cmake] exit.c:(.text.exit+0x2c): undefined reference to `_exit'
[cmake] collect2.exe: error: ld returned 1 exit status
[cmake] CMakeFiles\cmTC_9a74a.dir\build.make:97: recipe for target 'cmTC_9a74a' failed
[cmake] mingw32-make.exe[1]: *** [cmTC_9a74a] Error 1
[cmake] mingw32-make.exe[1]: Leaving directory 'C:/workspace/int_loopback_transfer/build/CMakeFiles/CMakeTmp'
[cmake] Makefile:126: recipe for target 'cmTC_9a74a/fast' failed
[cmake] mingw32-make.exe: *** [cmTC_9a74a/fast] Error 2
[cmake]
[cmake]
[cmake]
[cmake]
[cmake]
[cmake] CMake will not be able to correctly generate this project.
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:25 (project)
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/workspace/int_loopback_transfer/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "C:/workspace/int_loopback_transfer/build/CMakeFiles/CMakeError.log".
When I open the project inside the VSCode, CMake extensions asks for a location of the CMakeLists.txt file, which I provide and it can be seen inside the settings.json:
"cmake.sourceDirectory": "${workspaceFolder}/armgcc"
Other than that I made no changes the settings.
I found here that this problem is usually solved with a flag:
--specs=nosys.specs
But as much as I can see flags.cmake already contains this flag.
I am inexperienced with such complicated makefile as the template project provide. Is there anyone who had similiar problems that could share their VSCode settings?
Thanks!