I'm programming a 68hc11e1 microprocessor, using c. Does anyone know if it's possible to use stdio functions from c, to program a 68hc11e1. Everytime I compile it gives me an error when I try to use sscanf function. I'm trying to convert a string to float. I have inserted "#include <stdio.h>", but it still does not work. thanks __________________________________ |
|
question
Started by ●March 21, 2004
Reply by ●March 21, 20042004-03-21
It does work, but I do remember when I first tried sscanf I made about every mistake one could make. For example, pointers must be used in the variable list, use "int" not "char", etc. (I presume you are using a board with expanded memory, since the E1 only has 512 bytes of EEPROM and sscanf w floating pt pulls in a ton of subroutines (2 or 3 K as I remember).) Regards, Donald E Haselwood At 06:04 PM 3/21/04, you wrote: >I'm programming a 68hc11e1 microprocessor, using c. >Does anyone know if it's possible to use stdio >functions from c, to program a 68hc11e1. Everytime I >compile it gives me an error when I try to use sscanf >function. I'm trying to convert a string to float. I >have inserted "#include <stdio.h>", but it still does >not work. > >thanks > >__________________________________ > >Yahoo! Groups Links > > |
|
Reply by ●March 22, 20042004-03-22
Hi, What is the exact error message? Maybe your library does not implement the sscanf? Post a short extract of the source code here so we can have a loook. Erich > -----Original Message----- > From: n f [mailto:] > Sent: Montag, 22. Mz 2004 00:05 > To: > Subject: [m68HC11] question > I'm programming a 68hc11e1 microprocessor, using c. > Does anyone know if it's possible to use stdio > functions from c, to program a 68hc11e1. Everytime I > compile it gives me an error when I try to use sscanf > function. I'm trying to convert a string to float. I > have inserted "#include <stdio.h>", but it still does > not work. > > thanks > > __________________________________ > Yahoo! Groups Links |
|
Reply by ●March 22, 20042004-03-22
Hello, Is the error from the compiler (a syntax error perhaps)? Is the error from the linker (can't find the sscanf function perhaps)? Check the compiler documentation and make sure that sscanf needs stdio.h and not stdlib.h - I've found that some compilers use the stdlib.h header to declare the scanf() family of functions. Regards, Jim Dodd Onset Computer Corp. > -----Original Message----- > From: n f [mailto:] > Sent: Montag, 22. Mz 2004 00:05 > To: > Subject: [m68HC11] question > I'm programming a 68hc11e1 microprocessor, using c. > Does anyone know if it's possible to use stdio > functions from c, to program a 68hc11e1. Everytime I > compile it gives me an error when I try to use sscanf > function. I'm trying to convert a string to float. I > have inserted "#include <stdio.h>", but it still does > not work. > > thanks > __________________________________ |
Reply by ●March 22, 20042004-03-22
Here's my memory.x file: OUTPUT_FORMAT("elf32-m68hc11", "elf32-m68hc11", "elf32-m68hc11") OUTPUT_ARCH(m68hc11) ENTRY(_start) SEARCH_DIR(C:\usr\lib\gcc-lib\m6811-elf\3.3.1-m68hc1x-20031004 \mshort) MEMORY { ioports (!x) : org = 0x1000, l = 0x500 eeprom (!i) : org = 0xB600, l = 0x300 data (rwx) : org = 0x8800, l = 0x1000 text (rx) : org = 0x9000, l = 0x6000 } PROVIDE (_stack = 0x01ff-1); ------------------------- here's my project.mak file: OC = c:/usr/bin/m6811-elf-objcopy CC = c:/usr/bin/m6811-elf-gcc RM = C:/embeddedGNU/rm.exe CFLAGS = -m68hc11 -O3 -fno-ident -fno-common -fomit-frame-pointer - mshort -fsigned-char LDFLAGS = -Wl,-u,-mm68hc11elfb OCFLAGS = -O srec CSRCS=main.c OBJS=$(CSRCS:.c=.o) all: ourProject.elf ourProject.s19 $(OBJS): %.o: %.c $(CC) $(CFLAGS) -c $< ourProject.elf: $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -o ourProject.elf $(OBJS) ourProject.s19: ourProject.elf $(OC) $(OCFLAGS) ourProject.elf ourProject.s19 clean: $(RM) -f ourProject.elf $(RM) -f ourProject.s19 $(RM) -f ourProject.dmp $(RM) -f $(OBJS) --- basically this is what i'm adding: #include<stdio.h> UINT x; char *out = "1234.4213"; // this is what the data out looks like float fnum; x = sscanf(out, "%lf", &fnum); I can get the error later today, but i'm unable to get it now. |