[En-Nut-Discussion] 2.5.91 succes on linux

Theodore A. Roth troth at openavr.org
Mon Nov 4 19:24:24 CET 2002


Hi,

I've finally gotten 2.5.91 to build, burn and run basemon on my board.

Turns out I had changed the fuses on the mega128 to match my other
projects. Bad idea, I don't know what I was thinking.

Any ways, the build in 2.5.91 wasn't totally clean. I've attached a patch
which got things working for me.

For what it's worth:

  - build system is debian

These were build from cvs sources on the 28th:

  - avr-gcc (GCC) 3.3 20021028 (experimental)
  - avr-binutils 2.13.90 20021028
  - avr-libc 20021028cvs

I'll retest tonight on redhat-8.0 and redhat-7.3 with tonight's snapshots.

Ted Roth
-------------- next part --------------
2002-11-04  Theodore A. Roth  <troth at openavr.com>

	* app/Makedefs.gcc (BURNFLAGS): Add -dpart option so stk500 works.
		Might need the latest uisp from cvs to have this work with
		stk200.
	* configure: Remove '\r' (carriage returns) as it makes /bin/sh puke.
	* tools/crurom/crurom.c: Make it compile on linux. The shipped binary
		in tools/linux is broken. Copy the new binary to tools/linux
		before building the apps.

diff -urN nut-2.5.91/app/Makedefs.gcc nut-2.5.91-troth/app/Makedefs.gcc
--- nut-2.5.91/app/Makedefs.gcc	2002-11-02 08:55:28.000000000 -0800
+++ nut-2.5.91-troth/app/Makedefs.gcc	2002-11-04 09:58:01.000000000 -0800
@@ -75,4 +75,4 @@
 CPFLAGS   = $(MCFLAGS) -Os -Wall -Werror -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst) $(DEFS)

 #CPFLAGS  = -g $(MCFLAGS) -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst) $(DEFS)

 LDFLAGS   = $(MCFLAGS) -Wl,-Map=$(PROJ).map,--cref -L$(LIBDIR) 

-BURNFLAGS = -dprog=$(UISP_PROG) --erase --upload --verify if=$(TARG)

+BURNFLAGS = -dprog=$(UISP_PROG) -dpart=$(MCU) --erase --upload --verify if=$(TARG)

diff -urN nut-2.5.91/configure nut-2.5.91-troth/configure
--- nut-2.5.91/configure	2002-10-31 08:36:34.000000000 -0800
+++ nut-2.5.91-troth/configure	2002-11-04 09:52:41.000000000 -0800
@@ -1,84 +1,84 @@
-#! /bin/sh

-

-if [ "x`uname`" != "xLinux" ]

-then

-	echo "This is not a Linux system. I'm so confused!"

-	exit 1

-fi

-

-# Verify that avr-gcc is in the users PATH

-

-if ! avr-gcc --version >/dev/null 2>&1

-then

-	echo "Can't find avr-gcc. :-("

-	echo ""

-	echo "This could mean either of the following:"

-	echo "  1: You don't have avr-gcc installed."

-	echo "  2: You don't have your PATH environment variable set right."

-	echo "Here is your PATH variable:"

-	echo ""

-	echo $PATH

-	echo ""

-	exit 1

-fi

-

-# Make links to included make fragments

-

-[ -f Makedefs ]  || ln -s Makedefs.gcc Makedefs

-[ -f Makerules ] || ln -s Makerules.gcc Makerules

-

-[ -f app/Makedefs ]  || ln -s Makedefs.gcc app/Makedefs

-[ -f app/Makerules ] || ln -s Makerules.gcc app/Makerules

-

-# Ask user which device to target

-

-unset DEV

-while [ "x$DEV" = "x" ]

-do

-	echo "Select a target device:"

-	echo ""

-	echo "  1) ATmega128"

-	echo "  2) ATmega103"

-	echo ""

-	echo -n "Selection -> "

-	read answ

-

-	case "$answ" in

-	1) DEV=atmega128 ;;

-	2) DEV=atmega103 ;;

-	*)

-		echo "invalid choice" ;;

-	esac

-done

-

-# Ask which isp programmer is being used

-

-unset UISP_PROG

-while [ "x$UISP_PROG" = "x" ]

-do

-	echo "Which isp programmer are you using?"

-	echo ""

-	echo "  1) stk200, stk300 or compatible"

-	echo "  2) skt500"

-	echo ""

-	echo -n "Selection -> "

-	read answ

-

-	case "$answ" in

-	1) UISP_PROG=stk200 ;;

-	2) UISP_PROG=stk500 ;;

-	*)

-		echo "invalid choice" ;;

-	esac

-done

-

-# Generate the config file

-

-cat <<EOF > UserConf.mk

-MCU=$DEV

-UISP_PROG=$UISP_PROG

-CRUROM = \$(top_srcdir)/tools/linux/crurom

-EOF

-

-echo "Your system is now configured to build for $DEV."

-echo "Type \`make\` to build the system."

+#! /bin/sh
+
+if [ "x`uname`" != "xLinux" ]
+then
+	echo "This is not a Linux system. I'm so confused!"
+	exit 1
+fi
+
+# Verify that avr-gcc is in the users PATH
+
+if ! avr-gcc --version >/dev/null 2>&1
+then
+	echo "Can't find avr-gcc. :-("
+	echo ""
+	echo "This could mean either of the following:"
+	echo "  1: You don't have avr-gcc installed."
+	echo "  2: You don't have your PATH environment variable set right."
+	echo "Here is your PATH variable:"
+	echo ""
+	echo $PATH
+	echo ""
+	exit 1
+fi
+
+# Make links to included make fragments
+
+[ -f Makedefs ]  || ln -s Makedefs.gcc Makedefs
+[ -f Makerules ] || ln -s Makerules.gcc Makerules
+
+[ -f app/Makedefs ]  || ln -s Makedefs.gcc app/Makedefs
+[ -f app/Makerules ] || ln -s Makerules.gcc app/Makerules
+
+# Ask user which device to target
+
+unset DEV
+while [ "x$DEV" = "x" ]
+do
+	echo "Select a target device:"
+	echo ""
+	echo "  1) ATmega128"
+	echo "  2) ATmega103"
+	echo ""
+	echo -n "Selection -> "
+	read answ
+
+	case "$answ" in
+	1) DEV=atmega128 ;;
+	2) DEV=atmega103 ;;
+	*)
+		echo "invalid choice" ;;
+	esac
+done
+
+# Ask which isp programmer is being used
+
+unset UISP_PROG
+while [ "x$UISP_PROG" = "x" ]
+do
+	echo "Which isp programmer are you using?"
+	echo ""
+	echo "  1) stk200, stk300 or compatible"
+	echo "  2) skt500"
+	echo ""
+	echo -n "Selection -> "
+	read answ
+
+	case "$answ" in
+	1) UISP_PROG=stk200 ;;
+	2) UISP_PROG=stk500 ;;
+	*)
+		echo "invalid choice" ;;
+	esac
+done
+
+# Generate the config file
+
+cat <<EOF > UserConf.mk
+MCU=$DEV
+UISP_PROG=$UISP_PROG
+CRUROM = \$(top_srcdir)/tools/linux/crurom
+EOF
+
+echo "Your system is now configured to build for $DEV."
+echo "Type \`make\` to build the system."
diff -urN nut-2.5.91/tools/crurom/crurom.c nut-2.5.91-troth/tools/crurom/crurom.c
--- nut-2.5.91/tools/crurom/crurom.c	2002-08-08 08:23:19.000000000 -0700
+++ nut-2.5.91-troth/tools/crurom/crurom.c	2002-11-04 09:56:23.000000000 -0800
@@ -21,6 +21,15 @@
 #include <dirent.h>

 #endif

 

+#ifndef O_BINARY

+#define O_BINARY 0

+#endif

+

+#ifdef __linux__

+#define stricmp strcasecmp

+#define strnicmp strncasecmp

+#endif

+

 #include "getopt.h"

 

 #define IDENT   "crurom"

@@ -32,7 +41,7 @@
 static char rootdir[256];

 static int rootlen = 0;

 static char outname[256];

-static FILE *fpout = stdout;

+static FILE *fpout;

 

 int dofile(char *name)

 {

@@ -159,6 +168,10 @@
             return 3;

         }

     }

+    else

+    {

+        fpout = stdout;

+    }

 

     fprintf(fpout, "/*\n");

     fprintf(fpout, " * This file is automatically created by " IDENT " " VERSION "\n");



More information about the En-Nut-Discussion mailing list