I was able to build threadx as per README as below -
vscode@f5db10ae23ff:/workspaces/threadx-master$ cmake -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE=../cmake/cortex_m4.cmake .
-- The C compiler identification is GNU 13.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- THREADX_ARCH: cortex_m4
-- THREADX_TOOLCHAIN: gnu
-- Using default tx_user.h file
got here
-- Configuring done
-- Generating done
-- Build files have been written to: /workspaces/threadx-master/build
vscode@f5db10ae23ff:/workspaces/threadx-master$ cmake --build ./build
[193/193] Linking C static library libthreadx.a
vscode@f5db10ae23ff:/workspaces/threadx-master$ echo $?
0
vscode@f5db10ae23ff:/workspaces/threadx-master$ ls ./build/libthreadx.a
./build/libthreadx.a
vscode@f5db10ae23ff:/workspaces/threadx-master$
But, when I try to run the sample threadx demo in a devcontainer from vscode, I get an error. I created a CMakeLists.txt as below.
vscode@f5db10ae23ff:/workspaces/threadx-master/samples$ cmake -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE=../cmake/cortex_m4.cmake .
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/gcc-arm-none-eabi/bin/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc
-- THREADX_ARCH: cortex_m4
-- THREADX_TOOLCHAIN: gnu
-- Using default tx_user.h file
got here
-- Configuring done
-- Generating done
-- Build files have been written to: /workspaces/threadx-master/samples/build
vscode@f5db10ae23ff:/workspaces/threadx-master/samples$ cmake --build ./build
[28/195] Linking C executable demo
FAILED: demo
: && /opt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc -mthumb -mcpu=cortex-m4 --specs=nosys.specs -fdata-sections -ffunction-sections -mlong-calls -mthumb -mcpu=cortex-m4 -Wl,--gc-sections CMakeFiles/demo.dir/demo_threadx.c.obj -o demo && :
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libc.a(libc_a-closer.o): in function `_close_r':
closer.c:(.text._close_r+0xc): warning: _close is not implemented and will always fail
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libc.a(libc_a-lseekr.o): in function `_lseek_r':
lseekr.c:(.text._lseek_r+0x14): warning: _lseek is not implemented and will always fail
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libc.a(libc_a-readr.o): in function `_read_r':
readr.c:(.text._read_r+0x14): warning: _read is not implemented and will always fail
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libc.a(libc_a-writer.o): in function `_write_r':
writer.c:(.text._write_r+0x14): warning: _write is not implemented and will always fail
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: CMakeFiles/demo.dir/demo_threadx.c.obj: in function `main':
demo_threadx.c:(.text.main+0x10): undefined reference to `_tx_initialize_kernel_enter'
collect2: error: ld returned 1 exit status
[45/195] Building C object threadx/CMakeFiles/threadx.dir/common/src/tx_initialize_kernel_setup.c.obj
ninja: build stopped: subcommand failed.
vscode@f5db10ae23ff:/workspaces/threadx-master/samples$
Can someone help me troubleshoot and fix this ?
TIA
Hi All,
I was able to build threadx as per README as below -
But, when I try to run the sample threadx demo in a devcontainer from vscode, I get an error. I created a CMakeLists.txt as below.
The error I am getting is -
Can someone help me troubleshoot and fix this ? TIA