Autor: Fernando Rafael Filipuzzi
E-mail: fernando_6867@yahoo.com.ar
GEL 1.6.1 (GNU Embedded Libraries) es una colección de librerias para dispositivos embedded y ejemplos para los 68HC11 y 68HC12. Varias librerias son de general proposito que podrian ser implementadas en varias plataformas (boards). La documentación se encuentra en el tarball o en la página principal.
Otros enlaces:
host:/usr/src# mkdir gel_librar host:/usr/src# cd gel_librar host:/usr/src/gel_library# wget http://www.gnu-m68hc11.org/RPMS/gel-hc1x-1.6.1.tar.gz
make check
host:/usr/src/gel_library# aptitude install tcl8.4-dev dejagnu
En el fichero README del tarball se especifican las plataformas implementadas. La plataforma que elegí para este documento fue m68hc12-Ipac, solo es para probar, las librerias y los ejemplos no deberian tener problemas.
host:/usr/src/gel_library# tar zxvf gel-hc1x-1.6.1.tar.gz
host:/usr/src/gel_library# mv gel-hc1x-1.6.1 gel-hc1x-1.6.1-m68hc12-Ipac host:/usr/src/gel_library# cd gel-hc1x-1.6.1-m68hc12-Ipac
Con la siguiente linea se podría construir para la plataforma de desarrollo m68hc12-Ipa:
make TARGET_BOARD=m68hc12-Ipac CPU=m68hc12 DEVC_PREFIX=m6812-elf-
Algunos de los ficheros generados son:
./lib: libbsp.a libc.a libutil.a ./examples/calculator: calc.b calc.elf calc.o calc.s19
Surge error con el ejemplo hello porque esta fijado para otra plataforma con el cpu m68hc11.
Si solo utilizamos make es necesario modificar algunos ficheros. Por ejemplo para Ipac, a continuación se lista los archivos y variables modificados:
./config/board.def
: la variable TARGET_BOARD
tiene que tener el valor de la plataforma para la querramos construir las librerias y ejemplos:
TARGET_BOARD=m68hc12-Ipac #TARGET_BOARD=m68hc11-32k
./config/var.defs
: se debe fijar el prefijo que se utilizó para construir el GNU Toochain m68hc1x
#DEVC_PREFIX=m6811-elf- DEVC_PREFIX=m6812-elf-
./config/flags.defs
: lo mas importante es el CPU de la plataforma elegida:
#CPU=m68hc11 CPU=m68hc12
En este último fichero hay otras cosas como:
-mshort
para enteros de 16 bits o -mnoshort
para enteros de 32 bits.-g
).Valor | Significado | Depuración |
-O3 -fomit-frame-pointer | Máxima velocidad | La depuración no está permitida con esta opción. |
-Os | Buena optimización | La depuración está permitida- |
Sin optimización |
-Wall -Wmissing-prototypes
.Después de hacer:
host:/usr/local/gel-hc1x-1.6.1# make check
Dá el siguiente error:
... make[1]: Leaving directory `/usr/local/gel-hc1x-1.6.1' make -C testsuite check make[1]: Entering directory `/usr/local/gel-hc1x-1.6.1/testsuite' runtest --tool gel --target m6811-elf make[1]: runtest: Command not found make[1]: *** [check] Error 127 make[1]: Leaving directory `/usr/local/gel-hc1x-1.6.1/testsuite' make: *** [check] Error 2
Una solución encontrada en http://gcc.gnu.org/ml/gcc/1997-12/msg00625.html fue instalar dejagnu.
host:/usr/local/gel-hc1x-1.6.1# aptitude install dejagnu
Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. Using ./config/default.exp as tool-and-target-specific interface file. WARNING: Assuming target board is the local machine (which is probably wrong). You may need to set your DEJAGNU environment variable. Running ./gel.benchs/benchs.exp ... ERROR: Test ./../bin/bench-basic.elf does not exist ERROR: Test ./../bin/bench-misc.elf does not exist ERROR: Test ./../bin/bench-float.elf does not exist ERROR: Test ./../bin/bench-string.elf does not exist Running ./gel.examples/calculator.exp ... Running ./gel.examples/misc.exp ... ERROR: Test ./../bin/stack_depth.elf does not exist Running ./gel.examples/pulse.exp ... ERROR: Spawning m6811-elf-gdb failed. ERROR: no fileid for hp
La solución fue:
host:/usr/local/gel-hc1x-1.6.1# DEJAGNULIBS=/usr/share/dejagnu host:/usr/local/gel-hc1x-1.6.1# echo ${DEJAGNULIBS}
Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. Using ./config/default.exp as tool-and-target-specific interface file. WARNING: Assuming target board is the local machine (which is probably wrong). You may need to set your DEJAGNU environment variable. Running ./gel.benchs/benchs.exp ... ERROR: Test ./../bin/bench-basic.elf does not exist ERROR: Test ./../bin/bench-misc.elf does not exist ERROR: Test ./../bin/bench-float.elf does not exist ERROR: Test ./../bin/bench-string.elf does not exist Running ./gel.examples/calculator.exp ... Running ./gel.examples/misc.exp ... ERROR: Test ./../bin/stack_depth.elf does not exist Running ./gel.examples/pulse.exp ... ERROR: Spawning m6811-elf-gdb failed. ERROR: no fileid for hp ^Cgot a INT signal, interrupted by user === gel Summary === # of unresolved testcases 5 make[1]: *** [check] Error 1 make: *** [check] Interrupt
host:/usr/local/gel-hc1x-1.6.1# aptitude install tcl8.4-dev host:/usr/local/gel-hc1x-1.6.1# export TCL_LIBRARY=/usr/lib/tcl8.4