You are not logged in.
hello masters,
I'm trying to get GCC to compile code for Motorla's 68HC12 microcontroller. It seems default arch gcc is not configured for such things and I really dont want to get the old binutils from GNU to make this thing work. Does anyone know what I can do?
Thanks
Offline
What's the arch and target for that thing? See my sig, maybe those pkgbuilds can help you?
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
The target architecture is Motorola's 68HC12 microcontroller with Dragon 12 all on an evaluation board, it is normally used for robotics applications and control systems.
This thing is supported by GNU and I was "trying" to get the GNU embedded toolchain environment going but I get a compile error so that's a no go. Thanks for your reply I will check out your repo. On a different note, I already have the required environment and tool chains on RPM's or Debian .deb format. I was wondering if there is any way I can build an .tar.gz for easy installation on Arch. anyways thanks for your reply.
Offline
I was asking for the GNU architecture target name. For example i686-pc-linux-gnu or m86k-unknown-linux-gnu. I can try to get a package going for you if I know that.
If you have a toolchain on another distro, tell me the output of the following:
gcc -v
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
this is the output of gcc -v
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.3/configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --prefix=/usr --enable-shared --enable-languages=c,c++,objc --enable-threads=posix --enable-__cxa_atexit
I'm basically following the instruction here:
http://www.gnu.org/software/m68hc11/
The installation instructions are at:
http://www.gnu.org/software/m68hc11/m68 … t_ptc.html
building this for arch would be most kind of you.
Offline
Actually I meant the output of the cross gcc for m68hc12.
Nevertheless, the links you provided are more than enough info for building the toolchain. I am currently compiling binutils, gcc is coming later but I'll skip on the newlib target. If you have the time please use the repository and get the packages once they are available and report back if they were of any help.
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
I'm sorry for the wrong info, I'm a big fat noob. But yes basically the instructions are there in those URLs I posted. When compiling binutils, I came across a very peculiar error originating from one the header files. Hopefully you won't encounter it. As for checking the package I will definitely test it once it comes on your repo. And may I ask what is contained in newlib? Is it not needed for building the toolchain? And thank you again, you're saving me from having to code in assembler which is a daunting task.
Offline
Uploading all packages right now, A minor issue I've had in binutils 2.17:
--- binutils-2.17/gas/config/tc-m68hc11.c.orig 2006-11-18 23:30:49.000000000 +0100
+++ binutils-2.17/gas/config/tc-m68hc11.c 2006-11-18 23:31:08.000000000 +0100
@@ -2455,7 +2455,7 @@
char name[20];
int nlen = 0;
operand operands[M6811_MAX_OPERANDS];
- int nb_operands;
+ int nb_operands = 0;
int branch_optimize = 0;
int alias_id = -1;Not much as you can see. heh
[edit]
I already uploaded the pkgbuilds.
http://kth5.telekommunisten.net/crossto … lds.tar.gz
And to your question what newlib is, well. It's a small library that you can use instead of big stuff like glibc I guess. I have never worked with it really... ![]()
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
[root@Hell lucifer]# pacman -Ss 68
community/sane-gt68xx-firmware 1.0-2
gt68xx-based scanners firmwares
crosstools/crossbinutils-m68hc12 2.17-1
A set of programs to assemble and manipulate binary and object files for
m68hc12-elf-
crosstools/crossgcc-m68hc12 4.1.1-2
The GNU Compiler Collection for mips-unknown-linux-gnu
crosstools/crossheaders-m68hc12 2.6.12.0-1
System headers for m68hc12-elf
[root@Hell lucifer]#
Nice! Thanks a bunch.
Hopefully GCC and GDB are next ![]()
Offline
ignore the mips in the pkgdesc. ;p
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
I get this error msg when compiling:
/opt/cross/m6812-elf/bin/gcc-4.1.1 -m68hc12 -O3 -fno-ident -fno-common -fomit-frame-pointer -mshort -Wl,-u,-mm68hc12elfb -L./../../lib -o mainprog.c.elf mainprog.o
/opt/cross/m6812-elf/bin/m6812-elf-ld: this linker was not configured to use sysroots
collect2: ld returned 1 exit status
make: *** [mainprog.c.elf] Error 1the Makefile I'm using looks like this:
CSRCS=mainprog.c
OC = /opt/cross/m6812-elf/bin/m6812-elf-objcopy
CC = /opt/cross/m6812-elf/bin/gcc-4.1.1
RM = rm
CFLAGS = -m68hc12 -O3 -fno-ident -fno-common -fomit-frame-pointer -mshort
LDFLAGS = -Wl,-u,-mm68hc12elfb
OCFLAGS = -O srec
Navid_Dragon12_HOME = ./../../
INCDIR = $(Navid_Dragon12_HOME)include
LIBDIR = $(Navid_Dragon12_HOME)lib
OBJS=$(CSRCS:.c=.o)
all: $(CSRCS).elf 000.s19
$(OBJS): %.o: %.c
$(CC) $(CFLAGS) -I$(INCDIR) -c $<
$(CSRCS).elf: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -L$(LIBDIR) -o $(CSRCS).elf $(OBJS)
000.s19: $(CSRCS).elf
$(OC) $(OCFLAGS) $(CSRCS).elf 000.s19
clean:
$(RM) -f $(CSRCS).elf
$(RM) -f 000.s19
$(RM) -f $(CSRCS).dmp
$(RM) -f *~
$(RM) -f $(OBJS)
clear
Offline
Hmm, I will see what I can do tonight. Say, did you ever try that m86hc1x simulator? Does it work well? I'd go and look for sample code to compile and run in that to fix the problems.
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline