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

Compile on raspberry pi #2

Open
dorinilut opened this issue Feb 5, 2023 · 9 comments
Open

Compile on raspberry pi #2

dorinilut opened this issue Feb 5, 2023 · 9 comments

Comments

@dorinilut
Copy link

Hello,

Just tried to do a compile of this on a raspberry pi.
System Information is:
pi@rasptv:~/openthread-r21 $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Followed the instructions and all seemed to be in good working order until running the build. There I got the following message:

`pi@rasptv:~/openthread-r21 $ sudo bash script/build.sh

  • OT_CMAKE_NINJA_TARGET=

  • OT_SRCDIR=/home/pi/openthread-r21/script/..

  • readonly OT_SRCDIR

  • OT_OPTIONS=("-DCMAKE_TOOLCHAIN_FILE=${OT_SRCDIR}/src/arm-none-eabi-gcc.cmake" "-DCMAKE_BUILD_TYPE=Debug" "-DOT_PLATFORM=external" "-DOT_SLAAC=ON" "-DOT_APP_RCP=ON" "-DOT_RCP=ON" "-DOT_FTD=OFF" "-DOT_MTD=OFF" "-DOT_APP_CLI=OFF" "-DOT_APP_NCP=OFF")

  • readonly OT_OPTIONS

  • main

  • options=('-DCMAKE_TOOLCHAIN_FILE=/home/pi/openthread-r21/script/../src/arm-none-eabi-gcc.cmake' '-DCMAKE_BUILD_TYPE=Debug' '-DOT_PLATFORM=external' '-DOT_SLAAC=ON' '-DOT_APP_RCP=ON' '-DOT_RCP=ON' '-DOT_FTD=OFF' '-DOT_MTD=OFF' '-DOT_APP_CLI=OFF' '-DOT_APP_NCP=OFF')

  • local options

  • options+=("$@")

  • build -DCMAKE_TOOLCHAIN_FILE=/home/pi/openthread-r21/script/../src/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug -DOT_PLATFORM=external -DOT_SLAAC=ON -DOT_APP_RCP=ON -DOT_RCP=ON -DOT_FTD=OFF -DOT_MTD=OFF -DOT_APP_CLI=OFF -DOT_APP_NCP=OFF

  • local builddir=/home/pi/openthread-r21/script/../out/build

  • mkdir -p /home/pi/openthread-r21/script/../out/build

  • cd /home/pi/openthread-r21/script/../out/build

  • cmake -GNinja -DOT_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_TOOLCHAIN_FILE=/home/pi/openthread-r21/script/../src/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug -DOT_PLATFORM=external -DOT_SLAAC=ON -DOT_APP_RCP=ON -DOT_RCP=ON -DOT_FTD=OFF -DOT_MTD=OFF -DOT_APP_CLI=OFF -DOT_APP_NCP=OFF /home/pi/openthread-r21/script/..
    -- The C compiler identification is unknown
    -- The CXX compiler identification is unknown
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - failed
    -- Check for working C compiler: /home/pi/openthread-r21/gcc-arm-none-eabi/bin/arm-none-eabi-gcc
    -- Check for working C compiler: /home/pi/openthread-r21/gcc-arm-none-eabi/bin/arm-none-eabi-gcc - broken
    CMake Error at /usr/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
    The C compiler

    "/home/pi/openthread-r21/gcc-arm-none-eabi/bin/arm-none-eabi-gcc"

    is not able to compile a simple test program.

    It fails with the following output:

    Change Dir: /home/pi/openthread-r21/out/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/ninja cmTC_ed2ff && [1/2] Building C object CMakeFiles/cmTC_ed2ff.dir/testCCompiler.c.obj
    FAILED: CMakeFiles/cmTC_ed2ff.dir/testCCompiler.c.obj
    /home/pi/openthread-r21/gcc-arm-none-eabi/bin/arm-none-eabi-gcc -mcpu=cortex-m0plus -mfloat-abi=soft -mthumb -std=gnu99 -o CMakeFiles/cmTC_ed2ff.dir/testCCompiler.c.obj -c testCCompiler.c
    /bin/sh: 1: /home/pi/openthread-r21/gcc-arm-none-eabi/bin/arm-none-eabi-gcc: Exec format error
    ninja: build stopped: subcommand failed.

    CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
    CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!
See also "/home/pi/openthread-r21/out/build/CMakeFiles/CMakeOutput.log".
See also "/home/pi/openthread-r21/out/build/CMakeFiles/CMakeError.log".
`

Am I missing something?

@Haerteleric
Copy link
Collaborator

There is no Tooelchain yet to compile the firmware on arm. You will have to compile the RCP-Firmware on x64 for now

@Haerteleric
Copy link
Collaborator

hey i just had a look on the available ARM toolchains for the M0+.

Sadly there is only a toolchain for 64Bit ARM Corsscompiler. What version of Pi are you running ?

@dorinilut
Copy link
Author

dorinilut commented Feb 7, 2023

I can switch easily to a 64 bit version. I can do that as soon as I am home. I am on 32 bit version now. I will do that and retry and come back with an update. thank you for taking the time.

@Haerteleric
Copy link
Collaborator

I have not pushed the arm64 toolchain yet, cause i dont have hardware to verify at hand atm. Maybe wait till tomorrow or compile it on your main machine (or a x86_64 based VM).

@Haerteleric
Copy link
Collaborator

So i updated the bootstrap.sh script to check for the arch of the compiling Host.

I validated on a rpi3 running 64Bit RaspberryPi-OS.

you will have to delete the "gcc-arm-none-eabi" and "out" Folder and rerun the bootstrap.sh before the build.sh.
(Or start from scratch)

@dorinilut
Copy link
Author

sorry for the delay in update. thank you for the update. it did install. now there seems to be a new issue:

Open On-Chip Debugger 0.11.0-rc2
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select '.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: unable to find a matching CMSIS-DAP device

the device is plugged in and visible. here is the info returned by usb-devices

T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=01 Dev#= 39 Spd=12 MxCh= 0
D: Ver= 2.01 Cls=02(commc) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1cf1 ProdID=0030 Rev=01.00
S: Manufacturer=dresden elektronik ingenieurtechnik GmbH
S: Product=ConBee II
S: SerialNumber=DE2139555
C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I: If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

any pointers will be greatly appreciated.

@Haerteleric
Copy link
Collaborator

It seems like your Debugger is not detected correctly. What kind of Debugging-Tool are you using ?

@dorinilut
Copy link
Author

I would very much like to answer your question but unfortunately I cannot say. I think i'm going to wait till there is an official release. unfortunately I was hoping this would be a pretty straight forward process. I can find my way in Linux, but I am not an advanced user, so instead of you guys wasting your time with me it's better if you focus on your development. I'll do some more research on my own.

As far as I can tell I have the openocd as per instructions in the build and it is confirmed to be at the latest version.

@fuomag9
Copy link

fuomag9 commented Oct 28, 2023

sorry for the delay in update. thank you for the update. it did install. now there seems to be a new issue:

Open On-Chip Debugger 0.11.0-rc2 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "swd". To override use 'transport select '. Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Error: unable to find a matching CMSIS-DAP device

the device is plugged in and visible. here is the info returned by usb-devices

T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=01 Dev#= 39 Spd=12 MxCh= 0 D: Ver= 2.01 Cls=02(commc) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1cf1 ProdID=0030 Rev=01.00 S: Manufacturer=dresden elektronik ingenieurtechnik GmbH S: Product=ConBee II S: SerialNumber=DE2139555 C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm I: If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

any pointers will be greatly appreciated.

I have the same issue as you on an x86 ubuntu VM on proxmox, with my conbee 2 with USB passthrough.

openocd -f script/openocd_config/ATMEL-ICE-OpenOCD-samr21e18a.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: unable to find a matching CMSIS-DAP device

➜  openthread-r21 git:(main) lsusb
Bus 009 Device 002: ID 1a86:55d4 QinHeng Electronics SONOFF Zigbee 3.0 USB Dongle Plus V2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants