USRP2 firmware fixes for EDK 10.1 microblaze toolchain. Firmware now builds
authoreb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Sat, 4 Oct 2008 01:29:47 +0000 (01:29 +0000)
committereb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Sat, 4 Oct 2008 01:29:47 +0000 (01:29 +0000)
and runs correctly using these tools.

git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9708 221aa14e-8319-0410-a670-987f0aec2ac5

usrp2/firmware/Makefile.common
usrp2/firmware/lib/Makefile.am
usrp2/firmware/lib/abort.c [new file with mode: 0644]
usrp2/firmware/lib/db_init.c
usrp2/firmware/lib/exit.c [new file with mode: 0644]
usrp2/firmware/lib/u2_init.c

index f2f8f7d638e93a3b7abc4cc7f3f10a59aed90b60..0157113998cb3f4fccba29e42c5bb218d4f6a1e2 100644 (file)
@@ -31,11 +31,12 @@ AM_CFLAGS = $(STD_CFLAGS) -mxl-soft-mul    -mxl-barrel-shift
 #AM_CFLAGS = $(STD_CFLAGS) -mno-xl-soft-mul -mxl-barrel-shift
 
 
-LINKER_SCRIPT = $(top_srcdir)/lib/microblaze.ld
-#AM_LDFLAGS = -Wl,-T$(LINKER_SCRIPT) -Wl,-defsym -Wl,_STACK_SIZE=1024
-#AM_LDFLAGS = -Wl,-T$(LINKER_SCRIPT) -Wl,-Map -Wl,$@.map
-AM_LDFLAGS = -Wl,-T$(LINKER_SCRIPT)
-
+#LINKER_SCRIPT = $(top_srcdir)/lib/microblaze.ld
+#AM_LDFLAGS = -Wl,-T,$(LINKER_SCRIPT) -Wl,-defsym -Wl,_STACK_SIZE=1024
+#AM_LDFLAGS = -Wl,-T,$(LINKER_SCRIPT) -Wl,-Map -Wl,$@.map
+#AM_LDFLAGS = -Wl,-T,$(LINKER_SCRIPT)
+#AM_LDFLAGS = -Wl,-Map -Wl,$@.map -Wl,-defsym -Wl,_STACK_SIZE=2048
+AM_LDFLAGS = -Wl,-defsym -Wl,_STACK_SIZE=2048
 
 %.bin : %
        mb-objcopy -O binary $< $@
index a6dd47f6cbc1078ccd47515490d48b963455d20d..4fbdd67480920f1e79e6b255f3c73889e70a0ae4 100644 (file)
@@ -22,6 +22,7 @@ noinst_LIBRARIES = \
 
 
 libu2fw_a_SOURCES = \
+       abort.c \
        ad9510.c \
        ad9777.c \
        buffer_pool.c \
@@ -34,6 +35,7 @@ libu2fw_a_SOURCES = \
        eeprom.c \
        ethernet.c \
        eth_mac.c \
+       exit.c \
        hal_io.c \
        hal_uart.c \
        i2c.c \
diff --git a/usrp2/firmware/lib/abort.c b/usrp2/firmware/lib/abort.c
new file mode 100644 (file)
index 0000000..d1d7093
--- /dev/null
@@ -0,0 +1,32 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <nonstdio.h>
+
+extern void _exit(int status);
+
+void 
+abort(void)
+{
+  putstr("\n\nabort\n");
+  // FIXME loop blinking leds
+  _exit(-1);
+}
index d47beb11d85d30dd556cdad46eb2c368247a085c..3d49a51d70b2a869dc202d4d4d611ce5431927ff 100644 (file)
@@ -211,19 +211,13 @@ calc_dxc_freq(u2_fxpt_freq_t target_freq, u2_fxpt_freq_t baseband_freq,
   u2_fxpt_freq_t fs = U2_DOUBLE_TO_FXPT_FREQ(100e6);   // converter sample rate
   u2_fxpt_freq_t delta = target_freq - baseband_freq;
 
+#if 0
   printf("calc_dxc_freq\n");
   printf("  fs       = "); print_fxpt_freq(fs); newline();
   printf("  target   = "); print_fxpt_freq(target_freq); newline();
   printf("  baseband = "); print_fxpt_freq(baseband_freq); newline();
   printf("  delta    = "); print_fxpt_freq(delta); newline();
-  
-#if 0
-  printf("--- printed as uint64_t ---\n");
-  printf("  fs       = "); print_uint64(fs); newline();
-  printf("  target   = "); print_uint64(target_freq); newline();
-  printf("  baseband = "); print_uint64(baseband_freq); newline();
-  printf("  delta    = "); print_uint64(delta); newline();
-#endif
+#endif  
 
   if (delta >= 0){
     while (delta > fs)
@@ -301,17 +295,17 @@ compute_freq_control_word(u2_fxpt_freq_t target_freq, u2_fxpt_freq_t *actual_fre
   //   master = 100e6;
   //   v = (int) rint(target_freq / master_freq) * pow(2.0, 32.0);
 
-  printf("compute_freq_control_word\n");
-  printf("  target_freq = "); print_fxpt_freq(target_freq); newline();
+  //printf("compute_freq_control_word\n");
+  //printf("  target_freq = "); print_fxpt_freq(target_freq); newline();
 
   int32_t master_freq = 100000000;     // 100M
 
   int32_t v = ((target_freq << 12)) / master_freq;
-  printf("  fcw = %d\n", v);
+  //printf("  fcw = %d\n", v);
 
   *actual_freq = (v * (int64_t) master_freq) >> 12;
 
-  printf("  actual = "); print_fxpt_freq(*actual_freq); newline();
+  //printf("  actual = "); print_fxpt_freq(*actual_freq); newline();
 
   return v;
 }
diff --git a/usrp2/firmware/lib/exit.c b/usrp2/firmware/lib/exit.c
new file mode 100644 (file)
index 0000000..95a3bf4
--- /dev/null
@@ -0,0 +1,28 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+extern void _exit(int status);
+
+void 
+exit(int status)
+{
+  _exit(status);
+}
index 3a8961374c00a384344970c11968bacc5ccf3b39..4313c9502a04b1dd971281f4b299ffe52b7db11e 100644 (file)
@@ -44,7 +44,6 @@ get_hw_rev(void)
   ok &= eeprom_read(I2C_ADDR_MBOARD, MBOARD_REV_MSB, &u2_hw_rev_major, 1);
 }
 
-
 /*
  * We ought to arrange for this to be called before main, but for now,
  * we require that the user's main call u2_init as the first thing...