#1
Posted 12 November 2012 - 12:08 PM
So far I have the cross compiler+lm4tools+stellarisware running. I can build the stellaris examples and flash them without problems.
As I want to do some signal processing with my board, I'd like to build the CMSIS library. At least the DSPLib part (I don't need the RTOS right now). The library zip file has some scripts to build it using Keil, but as I'm a GNU+Linux user, I can't run Keil IDE.
Also unfortunately, I'm a total noob when talking about autotools, so...
Has anyone been able to build this library using GCC? Does anyone have a Makefile to automate building it?
Thanks in advance!
- skaidaif likes this
#2
Posted 12 November 2012 - 01:06 PM
You should be able to once you add the appropriate .c and .h includes into the stellaris makefile, unless you are tryiing to make a cmsis library.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 stellaris examples and flash them without problems.
As I want to do some signal processing with my board, I'd like to build the CMSIS library. At least the DSPLib part (I don't need the RTOS right now). The library zip file has some scripts to build it using Keil, but as I'm a GNU+Linux user, I can't run Keil IDE.
Also unfortunately, I'm a total noob when talking about autotools, so...
Has anyone been able to build this library using GCC? Does anyone have a Makefile to automate building it?
Thanks in advance!
#3
Posted 12 November 2012 - 02:09 PM
#4
Posted 12 November 2012 - 05:07 PM
#5
Posted 13 November 2012 - 08:15 AM
Past weekend I tried compiling a single DSPLib file and it worked flawlessly. I suspect writing a dirty Makefile that does the work will not be very painful even for an autotools noob like me. I just need to get some spare time, sit down and write it ¬_¬
#6
Posted 13 November 2012 - 01:09 PM
Its a learning experience. I'm sure you will learn alot doing it. Ask for help if you run into problems. Also, make sure you document your work here in a thread or you could also use the blog section in your account.Thanks again for help. I already knew that PDF, and had a look at it, but the procedure is full of TI compiler related stuff that I suspect is not necessary when building with GCC.
Past weekend I tried compiling a single DSPLib file and it worked flawlessly. I suspect writing a dirty Makefile that does the work will not be very painful even for an autotools noob like me. I just need to get some spare time, sit down and write it ¬_¬
#7
Posted 13 November 2012 - 09:43 PM
PART=LM4F120H5QR
PREFIX=arm-none-eabi-
CC=gcc
AR=ar
RM=rm
TEST_PATH=DSP_Lib/Source/BasicMathFunctions/
CFLAGS = -mthumb \
-mcpu=cortex-m4 \
-mfpu=fpv4-sp-d16 \
-mfloat-abi=softfp \
-Os \
-ffunction-sections \
-fdata-sections \
-std=c99 \
-Wall \
-DPART_${PART} \
-DARM_MATH_CM4 \
-D__FPU_PRESENT \
-IInclude
objects := $(patsubst $(TEST_PATH)%.c,obj/%.o,$(wildcard $(TEST_PATH)*.c))
testlib: test
$(PREFIX)$(AR) rcs testlib.a $(objects)
test: $(objects)
obj/%.o: $(TEST_PATH)%.c
$(PREFIX)$(CC) $(CFLAGS) -c $< -o $@
clean:
@$(RM) -f $(objects)
@$(RM) -f testlib.aIt worked as expected. The build process throws a lot of warnings like this:
Include/arm_math.h: In function 'arm_pid_q15': Include/arm_math.h:4828:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
But I suppose I can ignore them. When I get some more time, I'll try to add all the directories to the process and build the entire library. I hope it works
- bluehash likes this
#8
Posted 13 November 2012 - 10:19 PM
#9
Posted 17 November 2012 - 07:20 PM
Makefile.inc
Top level Makefile
Bottom level Makefile
Calling "make dsplib" builds the library. But unfortunately I have not been able to build the examples against it. This is what happens when I try to build arm_class_marks_example_f32.c:
$ arm-none-eabi-gcc -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Os -ffunction-sections -fdata-sections -std=c99 -Wall -DPART_LM4F120H5QR -DARM_MATH_CM4 -D__FPU_PRESENT -I../../../Include -L../../../Lib -ldsplib_lm4f arm_class_marks_example_f32.c -o arm_class_marks_example_f32 In file included from arm_class_marks_example_f32.c:67:0: ../../../Include/arm_math.h: In function 'arm_pid_q15': ../../../Include/arm_math.h:4828:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arm_class_marks_example_f32.c: At top level: arm_class_marks_example_f32.c:139:9: warning: return type of 'main' is not 'int' [-Wmain] /tmp/ccAAxx9S.o: In function `main': arm_class_marks_example_f32.c:(.text.startup.main+0x2e): undefined reference to `arm_mat_mult_f32' arm_class_marks_example_f32.c:(.text.startup.main+0x3a): undefined reference to `arm_max_f32' arm_class_marks_example_f32.c:(.text.startup.main+0x46): undefined reference to `arm_min_f32' arm_class_marks_example_f32.c:(.text.startup.main+0x50): undefined reference to `arm_mean_f32' arm_class_marks_example_f32.c:(.text.startup.main+0x5a): undefined reference to `arm_std_f32' arm_class_marks_example_f32.c:(.text.startup.main+0x64): undefined reference to `arm_var_f32' /home/jalon/sat/lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit': /home/jalon/src/stellaris/summon-arm-toolchain/build/arm-none-eabi/newlib/libc/stdlib/../../../../../gcc-linaro-4.6-2011.10/newlib/libc/stdlib/exit.c:65: undefined reference to `_exit' collect2: ld returned 1 exit status
I could understand the error about the linker not finding _exit symbol, but I can't really understand why the linker is not finding arm_* functions. I'm linking against the library, and if I browse the symbols inside the library using nm command, I can see the problematic functions. For example:
$ arm-none-eabi-nm ../../../Lib/libdsplib_lm4f.a | grep arm_mat_mult_f32 arm_mat_mult_f32.o: 00000000 T arm_mat_mult_f32
What am I doing wrong???
#10
Posted 17 November 2012 - 08:25 PM
$ arm-none-eabi-ld --gc-sections -L ../../../Lib -ldsplib_lm4f -Thello.ld arm_class_marks_example_f32.o -o arm_class_marks_example_f32
Unfortunately these examples are made to be tested using a simulator or a debugger. I have yet to set up my debugger. Is there a tutorial anywhere?
#11
Posted 18 November 2012 - 06:29 AM
http://forum.stellar...enocd/#entry549
#12
Posted 19 November 2012 - 07:47 PM
#13
Posted 21 November 2012 - 07:23 PM
Arm is moving CMSIS from http://onarm.com to http://arm.com/cmsis , including the CMSIS forum to http://forums.arm.com/
There is a CMSIS v3.01 (CMSIS-SP-00300-r3p1-00rel0.zip) on arm.com.
Ohh if anyone want to share their Stellarisware Makefiles (for arm-gcc) , that would be nice
/Bingo
- bluehash likes this
#14
Posted 22 November 2012 - 08:21 AM
Yesterday I also started writing some tutorials for Stellaris Launchpad development under Linux. Eventually I'll write one about building CMSIS, so stay tuned!
- bluehash and xpg like this
#15
Posted 28 November 2012 - 02:10 PM
#16
Posted 28 November 2012 - 05:12 PM
#17
Posted 29 November 2012 - 10:38 AM
This is what the datasheet says about hard faults:
Hard Fault. A hard fault is an exception that occurs because of an error during exception
processing, or because an exception cannot be managed by any other exception mechanism.
Hard faults have a fixed priority of -1, meaning they have higher priority than any exception with
configurable priority.
No other exception is triggered before the hard fault (I have an empty handler with a while(1); to catch all unused exceptions), and memset is not called while processing other exception, so for me it doesn't make sense that a hard fault exception is raised.
Reading a bit more, chapter 2.6.1 states that a hard fault can be caused also by a "Bus error on a vector read". I don't really know what that means exactly ¿?.
I'll also have to try reading HFAULTSTAT register to see if it sheds some light...
#19
Posted 02 December 2012 - 08:32 PM
I already saw that, but that project is built using CCS. Building CMSIS with CCS is an entirely different process, but thanks for the tip anyway!
#20
Posted 02 January 2013 - 12:30 PM
Was any solution ever found for this problem?
I hit the same issue while trying to get FreRTOS up and running. Everything works great until memset is called - which seem to generate a hard fault.
Even TI's stock example "/stellarisware/boards/ek-lm4f120xl/freertos_demo/gcc/freertos_demo.bin" locks up.
Also tagged with one or more of these keywords: cmsis, gcc
Stellaris ARM Technical Forums →
Compilers and IDEs →
GCC and CygwinStarted by pimmel , 17 Jan 2013 |
|
|
||
Stellaris ARM Technical Forums →
Compilers and IDEs →
gcc division problemStarted by logical , 21 Nov 2012 |
|
|
||
Stellaris ARM Technical Forums →
Code Vault →
Stellaris launchpad gcc makefile, startup file and linker script BSDStarted by scompo , 05 Nov 2012 |
|
|
||
Stellaris ARM Technical Forums →
General →
StellarisWare or CMSISStarted by Fred , 04 Nov 2012 |
|
|
||
Stellaris ARM Technical Forums →
Compilers and IDEs →
Stellaris launchpad development using Linux/gcc/lm4toolsStarted by pramode , 28 Oct 2012 |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












