ntfreak 0 Posted February 16, 2013 Share Posted February 16, 2013 Save yourself lots of grief and use gcc to link. Too many tutorials use ld and it generally will end in tears. Spen scompo 1 Quote Link to post Share on other sites
spirilis 1,265 Posted February 4, 2014 Share Posted February 4, 2014 @@doragasu Good stuff with your tutorial, I went ahead and compiled CMSIS-DSP for my TivaWare install using your instructions and it worked. Haven't tried any of the examples but just wanted to get the library there. Then in my Makefile (which I derived from the TivaWare examples) I use this: # # Include the common make definitions. # include ${ROOT}/makedefs # # Where to find header files that do not live in the source directory. # IPATH=${ROOT} # Include CMSIS-DSP support CFLAGS += -D__FPU_PRESENT -I${ROOT}/../cmsis-src/CMSIS/Include LDFLAGS += -L${ROOT}/../cmsis-src/CMSIS/Lib -ldsplib_lm4f Compiling one of my existing programs, no complaints. Nothing CMSIS-DSP in that application though, but GCC can find the lib and everything. I'm using CLI + VI + Makefile development, no IDE here, so this is sufficient. edit: although, I'm seeing that the TivaWare Makefile example uses ld for linking, so I may want to modify that. The TivaWare makedefs seems to run ld with specific paths to libc, libm, etc. using GCC's -print-<x>-name feature though: # # The command for calling the linker. # LD=${PREFIX}-ld # # The flags passed to the linker. # LDFLAGS=--gc-sections # # Get the location of libgcc.a from the GCC front-end. # LIBGCC:=${shell ${CC} ${CFLAGS} -print-libgcc-file-name} # # Get the location of libc.a from the GCC front-end. # LIBC:=${shell ${CC} ${CFLAGS} -print-file-name=libc.a} # # Get the location of libm.a from the GCC front-end. # LIBM:=${shell ${CC} ${CFLAGS} -print-file-name=libm.a} so I'm not sure I need to change that. Guess I should run one of the CMSIS-DSP examples and try. edit: trying arm fir example, all kinds of crap I need to work through there Quote Link to post Share on other sites
spirilis 1,265 Posted February 4, 2014 Share Posted February 4, 2014 Got it working, finally... Makefile has something looking like this: # # Where to find header files that do not live in the source directory. # IPATH=${ROOT} # CMSIS DSP library CMSIS=${ROOT}/../cmsis-src CFLAGS += -D__FPU_PRESENT -DARM_MATH_CM4 -I${CMSIS}/CMSIS/Include -I${CMSIS}/Device/ARM/ARMCM4/Include ${COMPILER}/libdsplib_tm4c.a: @cp -f ${CMSIS}/CMSIS/Lib/libdsplib_tm4c.a ${COMPILER}/ and you can include/disinclude libdsplib_tm4c.a as needed: # # Rules for building the project. Add additional ${COMPILER}/srcfile.o type of entries for additional files. # ${COMPILER}/${PROGNAME}.axf: ${COMPILER}/${PROGNAME}.o #${COMPILER}/${PROGNAME}.axf: ${COMPILER}/libdsplib_tm4c.a ${COMPILER}/${PROGNAME}.axf: ${COMPILER}/startup_${COMPILER}.o ${COMPILER}/${PROGNAME}.axf: ${PART}.ld SCATTERgcc_${PROGNAME}=${PART}.ld ENTRY_${PROGNAME}=ResetISR Got arm_fir_example running; if success, it would switch on the backlight on the LCD display I had attached to my Tiva. I moved that line to the failure section too and verified that the backlight never turned on, so I assume the math portion ran successfully and it didn't hang up anywhere. This is with using LD for the linker, not GCC, but using the TivaWare examples' command which runs gcc as a frontend to print out the location of its intended libc, libm, libgcc libraries. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.