Jump to content
43oh

Anyone building CMSIS under Linux?


Recommended Posts

  • 11 months later...
  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Thanks for the info. You can already find my makefiles shared in this post. Using them I have successfully built CMSIS3.0 DSPLib. I have to test if it also works for 3.01 version.   Yesterday I also

I have recently received my Stellaris Launchpad and I'm building a toolchain to code for it using GNU+Linux.   So far I have the cross compiler+lm4tools+stellarisware running. I can build the stella

I had some time and started writing a test makefile, that builds all .c files inside a DSPLib subdirectory and creates a library with them:   PART=LM4F120H5QR PREFIX=arm-none-eabi- CC=gcc AR=ar RM

@@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 :D

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...