Closed devbis closed 3 years ago
I provided several changes to allow compiling the firmware for jn51xx chips on Linux systems using the BA2 toolchain. I added an instruction for building on Linux as well as on Windows.
The major change is the renaming of top-level directories 'Module Radio' -> 'ModuleRadio' (and 'Module Wifi' -> 'ModuleWifi' for consistency) It fixes the issue when make on Linux treat names with spaces as two files.
Another fixed problem was removing py2exe compiled binaries and replacing them with pure python scripts. So building on Linux requires python2.7 and installed
amara
library that can be installed from PyPI in a generic wayWindows part is not affected by the changes and compiles successfully too.
Compiling on Linux can be used for non-windows users as well for creating automated builds.
Thanks!
Just want to say this is AWESOME! This would let me delete my Windows VM that I'm currently using just for this 😅
I fixed several issues in ZPSConfig.py and it returns missing ZDOServers entries in zps_gen.c Also I modifies deps in Makefile to eliminate error with missing pdum_apdu.S that allows building the firmware in one run.
I fixed parallel build to increase building speed in -jXXX mode
I introduced an example YAML file for GitHub actions that allows compiling 16 firmware binaries with different build options at once.
https://github.com/devbis/ZiGate/blob/auto_build/.github/workflows/c-cpp.yml
It may help introducing CI/CD integration for ZiGate
It works! Are there any problems preventing the merge @fairecasoimeme ?
I rebased the PR on the top of the master branch
ok thanks for fix
Looks like some Python modules have to be installed , as well as some cross compiler
It is described in the readme section https://github.com/fairecasoimeme/ZiGate/tree/master/ModuleRadio/Firmware/src#linux You can compile GCC binaries or download pre-compiled ones.
Thanks got it.
Unfortunatly the cross compiler do not compile on Fedora distribution!
Building JTAG Release r36379
AUTOHEAD stamp-h1
CONFIG.S stamp-h
CONFIG.S Makefile
CC jp3.o
CC jp-io.o
CC ftdi_driver.o
jp-io.c:28:11: fatal error: 'sys/io.h' file not found
#include <sys/io.h>
^~~~~~~~~~
In file included from ftdi_driver.c:35:
./ftdi_driver.h:78:28: warning: declaration of 'struct ftdi_context' will not be visible outside of this function [-Wvisibility]
void ftdi_set_state(struct ftdi_context *ftdi, int state);
^
./ftdi_driver.h:79:32: warning: declaration of 'struct ftdi_context' will not be visible outside of this function [-Wvisibility]
void ftdi_set_state_buf(struct ftdi_context *ftdi, uint8_t *buf, int sz);
^
./ftdi_driver.h:80:27: warning: declaration of 'struct ftdi_context' will not be visible outside of this function [-Wvisibility]
int ftdi_get_state(struct ftdi_context *ftdi);
^
ftdi_driver.c:1492:4: error: use of undeclared identifier 'ftdi_chunk'
ftdi_chunk = 0;
^
ftdi_driver.c:1497:4: error: use of undeclared identifier 'ftdi_chunk'
ftdi_chunk = -1;
^
ftdi_driver.c:1500:3: error: use of undeclared identifier 'ftdi_chunk'
ftdi_chunk = strtol(str, NULL, 0);
^
ftdi_driver.c:1502:4: error: use of undeclared identifier 'ftdi_chunk'
ftdi_chunk *= 1000000;
^
ftdi_driver.c:1506:4: error: use of undeclared identifier 'ftdi_chunk'
ftdi_chunk *= 1000;
^
ftdi_driver.c:1532:3: warning: implicit declaration of function 'select_clk_edge_mode' is invalid in C99 [-Wimplicit-function-declaration]
select_clk_edge_mode(clk_edge_mode);
^
4 warnings and 5 errors generated.
make: *** [Makefile:79: ftdi_driver.o] Error 1
make: *** Waiting for unfinished jobs....
1 error generated.
make: *** [Makefile:79: jp-io.o] Error 1
Build failed!
jp-io.c:28:11: fatal error: 'sys/io.h' file not found
#include <sys/io.h>
so sys/io.h
is missing.
Then:
sudo dnf provides */sys/io.h
tells you that you need glibc-headers
Hope this helps
rpm -qa | grep glibc-headers glibc-headers-2.31-6.fc32.armv7hl
I run Arch Linux and this works great for me. Granted, I have quite a few cross-compiler toolchains installed for various projects, but I'm spinning up a Fedora VM now to test this compilation out.
I run Arch Linux and this works great for me. Granted, I have quite a few cross-compiler toolchains installed for various projects, but I'm spinning up a Fedora VM now to test this compilation out.
Just confirmed that this works out of the box in the latest Fedora Workstation after following instructions specified in the README
. @pipiche38 any chance you're using a 64-bit ARM processor? Wondering if you might need to use <asm/io.h>
instead of <sys/io.h>
: https://bugzilla.redhat.com/show_bug.cgi?id=1116162#c1
I provided several changes to allow compiling the firmware for jn51xx chips on Linux systems using the BA2 toolchain. I added an instruction for building on Linux as well as on Windows.
The major change is the renaming of top-level directories 'Module Radio' -> 'ModuleRadio' (and 'Module Wifi' -> 'ModuleWifi' for consistency) It fixes the issue when make on Linux treat names with spaces as two files.
Another fixed problem was removing py2exe compiled binaries and replacing them with pure python scripts. So building on Linux requires python2.7 or python3.4+ and installed
xmltodict
library that can be installed from PyPI in a generic wayWindows part is not affected by the changes and compiles successfully too.
Compiling on Linux can be used for non-windows users as well for creating automated builds.
Thanks!