Building ZBOSS for a BeagleBone Black
Hi,
I am trying to build the ZBOSS stack for a beaglebone black, running an ARM XAM3359 Cortex 9 processor.
So far I have tried making a C project in eclipse, and building the source code. It didn't work. I get a bunch of errors, first one being #error port me!
Since the beaglebone is meant to run linux I defined #define UNIX, but this didn't change anything. I see alot of IAR references in here and in the code.
Is there an IAR compiler that will build a stack which can run on the beaglebone?
Thanks a lot
Ivan
Replies (5)
RE: Building ZBOSS for a BeagleBone Black
SOLVED
The linux header include path was incorrect, which caused the type conflicts.
The correct include path is /KERNEL/kernel
Ivan
RE: Building ZBOSS for a BeagleBone Black
Hi,
After alot of testing I have gotten a better understanding of the situation. I managed to compile a suitable kernel for the beaglebone and link the headers from KERNEL/include.
I compile the stack with the same toolchain that is used for the kernel, the linaro arm-linux-gnueabi cross compiler:
http://eewiki.net/display/linuxonarm/BeagleBone#BeagleBone-ARMCrossCompiler:GCC
I use the PATH variable and set it to the toolchains bin directory.
But I still cannot avoid errors when compiling the stack. Some types are apparently defined in the linux headers, and also in a set of headers which came with the toolchain. These types cause errors since they are
defined differently in the two libraries.
Could there be some define that you need to declare before compiling, or maybe some kind of compiler setting? Or maybe even some headers that I should remove(gasping here)?
At the momemt I am really quite baffled. Btw I am using the latest version of the stack, and not the stable one.
Any help would be greatly appreciated.
Thanks
Br
Ivan
RE: Building ZBOSS for a BeagleBone Black
Hi,
As you can see, zb_mac_transport_linux_spidev.c includes several headers from linux. Looks like your distro configured (or it's possible that it is really too different)
As far as I remember, glibc developers hide __fds_bits. You could try something like #define _GNU_SOURCE in src/port/linux/include/port_before.h or just try another distro.
RE: Building ZBOSS for a BeagleBone Black
Hello again,
I tried following your steps, and made somewhat progress.
I managed to get the stack to build, after using the make rebuild command.
The build stopped with this in the terminal.
"
s_bits’
zb_mac_transport_linux_spidev.c:347:3: error: ‘fd_set’ has no member named ‘__fds_bits’
zb_mac_transport_linux_spidev.c:390:3: error: passing argument 2 of ‘select’ from incompatible pointer type [-Werror]
In file included from /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/include/sys/types.h:219:0,
from /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/include/stdlib.h:314,
from ../../osif/include/zb_osif_unix.h:17,
from ../../osif/include/zb_osif.h:22,
from ../../include/zb_g_context.h:12,
from ../../include/zb_common.h:17,
from zb_mac_transport_linux_spidev.c:12:
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/include/sys/select.h:106:12: note: expected ‘struct fd_set restrict’ but argument is of type ‘struct fd_set ’
zb_mac_transport_linux_spidev.c:422:11: error: ‘fd_set’ has no member named ‘__fds_bits’
cc1: all warnings being treated as errors
make[1]: *** [zb_mac_transport_linux_spidev.o] Error 1
make[1]: Leaving directory `/home/ivan/ZBOSS/TestProjectCpp/osif/unix'
make: *** [bldall] Error 2
ivan@ubuntu:~/ZBOSS/TestProjectCpp$
"
You write something about modifying spidev after compilation, could the line "zb_mac_transport_linux_spidev.c:422:11: error: ‘fd_set’ has no member named ‘__fds_bits’" be related to this or is it caused by something else?
In general I could use a hint for modifying spidev :)
Thanks a lot
Br
Ivan
RE: Building ZBOSS for a BeagleBone Black
Hi Ivan,
For BeagleBone the best option is using linux build instructions as reference.
1. Download and unpack stack.
2. Put proper options and platform files
ln -s build-configurations/Platform-linux-arm Platform
ln -s build-configurations/Options-linux-arm-debug Options
3. Modify toolchain that you're going to use in Options file by replacing CC = arm-none-linux-gnueabi-gcc with whatever you need.
4. Compile
These steps allow you to build stack. Then you need to modify spidev (if you're using SPI as an interface between Radio and MCU) or implement/modify new driver for your transport.
The only pre-processor definition you need for porting is ZB_PLATFORM_LINUX_ARM_2400. It can be used as reference. Also, please note, that building linux version requires access to Linux headers (set in the same Options file LINUX_HDRS = ...)