Embedded Freaks..

September 28, 2010

Compiling Nut/OS-4.9.9 with CodeSourcery GCC

Filed under: Uncategorized — kunilkuda @ 7:08 pm

The Nut/OS-4.9.9 needs Yagarto GCC to compile for ARM7 series, while I’m using CodeSourcery GCC. Here’s some patch to fix the compilation

diff -Naur ethernut-4.9.9/nut/Makevars.arm-gcc ethernut-nutconf_bug-4.9.9/nut/Makevars.arm-gcc
--- ethernut-4.9.9/nut/Makevars.arm-gcc	2009-08-13 23:31:41.000000000 +0800
+++ ethernut-nutconf_bug-4.9.9/nut/Makevars.arm-gcc	2010-09-28 18:07:14.788549190 +0800
@@ -39,7 +39,7 @@
 include $(top_srcdir)/Makevars.gcc

 # Set target specific variables.
-TRGT       = arm-elf-
+TRGT       = $(HOME)/workspace/codesourcery/bin/arm-none-eabi-
 MCFLAGS    = -mcpu=$(MCU)
 CFLAGS_MCU = $(MCFLAGS) -mthumb-interwork
 CXXFLAGS_MCU = $(CFLAGS_MCU)

diff -Naur ethernut-4.9.9/nut/os/osdebug.c ethernut-nutconf_bug-4.9.9/nut/os/osdebug.c
--- ethernut-4.9.9/nut/os/osdebug.c	2010-04-15 01:59:11.000000000 +0800
+++ ethernut-nutconf_bug-4.9.9/nut/os/osdebug.c	2010-09-28 18:22:36.868665145 +0800
@@ -116,7 +116,7 @@
 void NutDumpThreadQueue(FILE * stream, NUTTHREADINFO * tdp)
 {
 #ifdef ARCH_32BIT
-    static prog_char fmt[] = "%08lX %-8s %4u %s %08lX %08lX %08lX %9lu %s\n";
+    static prog_char fmt[] = "%08X %-8s %4u %s %08X %08X %08X %9u %s\n";
 #else
     static prog_char fmt[] = "%04X %-8s %4u %s %04X %04X %04X %5u %s\n";
 #endif
@@ -156,8 +156,8 @@
 {

 #ifdef ARCH_32BIT
-    static prog_char fmt1[] = "%08lX %-8s %4u %s %08lX %08lX %08lX %9lu %s";
-    static prog_char fmt2[] = " %08lX";
+    static prog_char fmt1[] = "%08X %-8s %4u %s %08X %08X %08X %9u %s";
+    static prog_char fmt2[] = " %08X";
 #else
     static prog_char fmt1[] = "%04X %-8s %4u %s %04X %04X %04X %5u %s";
     static prog_char fmt2[] = " %04X";
@@ -209,9 +209,9 @@
     static prog_char tname[] = "NutEventTimeout";
 #ifdef ARCH_32BIT
     static prog_char theader[] = "Address  Ticks  Left Callback\n";
-    static prog_char fmt1[] = "%08lX%6lu%6lu ";
+    static prog_char fmt1[] = "%08X%6lu%6lu ";
     static prog_char fmt2[] = "%09lX";
-    static prog_char fmt3[] = "(%08lX)\n";
+    static prog_char fmt3[] = "(%08X)\n";
 #else
     static prog_char theader[] = "Addr Ticks  Left Callback\n";
     static prog_char fmt1[] = "%04X%6lu%6lu ";
@@ -263,9 +263,9 @@
 {

 #ifdef ARCH_32BIT
-    static prog_char fmt1[] = "%08lx %9ld\n";
-    static prog_char fmt2[] = "%lu counted, but %lu reported\n";
-    static prog_char fmt3[] = "%lu bytes free\n";
+    static prog_char fmt1[] = "%08x %9d\n";
+    static prog_char fmt2[] = "%u counted, but %u reported\n";
+    static prog_char fmt3[] = "%u bytes free\n";
 #else
     static prog_char fmt1[] = "%04x %5d\n";
     static prog_char fmt2[] = "%u counted, but %u reported\n";
Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: