Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running sample demo #396

Open
z3r0g2017 opened this issue Jun 30, 2024 · 0 comments
Open

Error running sample demo #396

z3r0g2017 opened this issue Jun 30, 2024 · 0 comments
Labels
bug Something isn't working hardware New hardware or architecture support request

Comments

@z3r0g2017
Copy link

Hi All,

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.

cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
project(demo)

# set(THREADX_ARCH linux)
set(THREADX_ARCH cortex_m4)
set(THREADX_TOOLCHAIN gnu)

add_subdirectory(.. threadx)
# add_library(threadx)

target_compile_options(threadx PRIVATE
    -mthumb
    # other compile options
)

add_executable(${PROJECT_NAME} demo_threadx.c)
target_link_libraries(${EXECUTABLE} threadx)
include_directories(SYSTEM BEFORE ../common/inc ../ports/linux/gnu/inc /usr/include ../build)

The error I am getting is -

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

@z3r0g2017 z3r0g2017 added bug Something isn't working hardware New hardware or architecture support request labels Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hardware New hardware or architecture support request
Projects
None yet
Development

No branches or pull requests

1 participant