How to add a static library to the zigbit core

Hallo all,
I’m new to this forum and Arduino, so be patient if I choose wrong wording or did not grab the basics of the Arduino environment.
After visiting the forum and looking at all the cool stuff, that is done with this plattform, I found a article in the hardware forum L1), discussing the opportunity of using the Meshnetics/Atmel Zigbit modules as an Arduino plattform.

Recently I started a new core, which links against libradio_wdba1281.a of the µracoli project (L2).

Everything is fine, when I’m using the Makefile for compiling the sketches, but my current problem is, that there is no hook in the “hardware/boards.txt”, that allows to add more linker options (-l and -L)

Offcourse I could add all related uracoli source files to the core, but I think that a static library and one header file is more compact.

My first makefile based sketch sends periodically frames and looks so:

void setup() {
  Radio.begin();
}

void loop() {
  static uint8_t txbuf[] = {
      1, 0, 0, /* 802.15.4 data frame */
      'H','e','l','l','o',' ', /* data */
      'A','r','d','u','i','n','o','!', 
      'X','X'    
  };
  Radio.setState(STATE_TX);
  Radio.sendFrame(sizeof(txbuf), txbuf, 0);
  txbuf[2]++;
  delay(1000);
}

Best Regards Axel

Could fix it while doing a rebuild of the GUI, see attached patch against svn:


Index: app/src/processing/app/debug/Compiler.java
===================================================================
--- app/src/processing/app/debug/Compiler.java      (Revision 823)
+++ app/src/processing/app/debug/Compiler.java      (Arbeitskopie)
@@ -172,6 +172,11 @@
 
     baseCommandLinker.add(runtimeLibraryName);
     baseCommandLinker.add("-L" + buildPath);
+    baseCommandLinker.add("-L" + corePath);
+    String avrLdFlags = boardPreferences.get("build.ldflags");
+    if (avrLdFlags != null) {    
+        baseCommandLinker.add(avrLdFlags);
+    }
     baseCommandLinker.add("-lm");
 
     execAsynchronously(baseCommandLinker);
Index: hardware/arduino/boards.txt
===================================================================
--- hardware/arduino/boards.txt      (Revision 823)
+++ hardware/arduino/boards.txt      (Arbeitskopie)
@@ -218,3 +218,23 @@
 atmega8.build.f_cpu=16000000L
 atmega8.build.core=arduino
 
+##############################################################
+
+zigbit24.name=Zigbit 2400MHz, w/ ATmega1281
+
+zigbit24.upload.protocol=stk500v1
+zigbit24.upload.maximum_size=126976
+zigbit24.upload.speed=9600
+
+zigbit24.bootloader.low_fuses=0xe2
+zigbit24.bootloader.high_fuses=0x10
+zigbit24.bootloader.extended_fuses=0xff
+zigbit24.bootloader.path=atmega
+zigbit24.bootloader.file=ATmegaBOOT_168_zigbit24.hex
+zigbit24.bootloader.unlock_bits=0x3F
+zigbit24.bootloader.lock_bits=0xeF
+
+zigbit24.build.mcu=atmega1281
+zigbit24.build.f_cpu=8000000L
+zigbit24.build.core=zigbit
+zigbit24.build.ldflags=-lradio_wdba1281

Here is an initial version of the Zigbit Overlay Package for arduino-0017.

When the Savannah mirrors are updated, you can check out this link:
http://download.savannah.gnu.org/releases/uracoli/precompiled/arduino-0017-uracoli.zip

The building of sketches (examples/Radio) was tested on Linux. There is no bootloader yet added, see README.zigbit for details.

Any feedback is welcome, please report bugs here:

Cheers, Axel