From marnix.janse at gmail.com Thu Apr 5 16:55:34 2012 From: marnix.janse at gmail.com (Marnix Janse) Date: Thu, 5 Apr 2012 18:55:34 +0200 Subject: Unable to compile firmware Message-ID: Greetings to you all. This is my first message to this mailinglist. I received the SIMtrace hardware this week and I seem to get stuck at the point of making the firmware at this point: make BOARD=SIMTRACE DEBUG=1 TARGET=main_simtrace I am following the usernamual2.pdf,and I am trying to use my head, so far without too much success. The step before that is going fine: make -f Makefile.dfu BOARD=SIMTRACE Can anyone point me in the right direction on what toolchain to use and help me with the make-ussues below? Thank you, Marnix ------------------------------------------------------------------------------------------------------------------------------------------------ - I tried: - Linux-builds: CentOS 6.2 64-bitsVM, a CentOS 6.2 32-bitsVM and finally an Ubuntu 11.10 32-bits VM. - ARM-toolchain: GNU-arm (from the Wiki) and the CodeSourcery (advised at the openpcd website) - Result: With GNUarm: marnix at ubuntu:~/openpcd/firmware$ make BOARD=SIMTRACE DEBUG=1 TARGET=main_simtrace -------- begin (mode: RUN_FROM_ROM) -------- arm-elf-gcc (GCC) 3.4.3 Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Assembling (ARM-only): src/start/Cstartup_app.S arm-elf-gcc -c -mcpu=arm7tdmi -I. -x assembler-with-cpp -DRUN_FROM_ROM -D__AT91SAM7S128__ -Wa,-adhlns=src/start/Cstartup_app.lst,--gdwarf-2 -Iinclude/ -D__ASSEMBLY__ src/start/Cstartup_app.S -o src/start/Cstartup_app.o /home/marnix/gnuarm/bin/../lib/gcc/arm-elf/3.4.3/../../../../arm-elf/bin/as: unrecognized option '--gdwarf-2' make: *** [src/start/Cstartup_app.o] Error 1 When I change DEBUG-format from dwarf-2 to stabs I get this error: DEBUGF = stabs #DEBUGF = dwarf-2 Linking: main_simtrace.elf arm-elf-gcc -mcpu=arm7tdmi -I. -gstabs -DRUN_FROM_ROM -D__MS_types__ -D__LIBRFID__ -DDEBUG -DSIMTRACE -D__AT91SAM7S128__ -Isrc/simtrace -Iinclude -Isrc -O2 -Wall -Wextra -Wcast-align -Wimplicit -Wunused -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow - Wbad-function-cast -Wsign-compare -Waggregate-return -Wa,-adhlns=src/start/Cstartup_app.lst -I../../librfid//include/ -ffunction-sections -fdata-sections -MD -MP -MF .dep/main_simtrace.elf.d src/start/Cstartup_app.o lib/changebit.o lib/clearbit.o lib/setbit.o lib/testchangebit.o lib/testclearbit.o lib/testsetbit.o lib/lib1funcs.o lib/div64.o lib/lib_AT91SAM7.o lib/vsprintf.o lib/ctype.o lib/string.o src/os/pcd_enumerate.o src/os/fifo.o src/os/dbgu.o src/os/led.o src/os/req_ctx.o src/os/trigger.o src/os/main.o src/os/syscalls.o src/os/usb_handler.o src/os/usb_benchmark.o src/os/tc_cdiv.o src/os/pit.o src/os/pwm.o src/os/pio_irq.o src/os/usbcmd_generic.o src/os/wdt.o src/os/blinkcode.o src/os/system_irq.o src/os/flash.o src/simtrace/iso7816_uart.o src/simtrace/tc_etu.o src/simtrace/sim_switch.o src/simtrace/spi_flash.o src/simtrace/main_simtrace.o --output main_simtrace.elf - nostartfiles -Wl,-Map=main_simtrace.map,--cref -lc -lgcc -L../../librfid//src/.libs/ -Wl,--gc-sections -Wl,--entry=_startup -Tlink/AT91SAM7S128-ROM-sam7dfu-app.ld src/simtrace/sim_switch.o(.bss.stats+0x0): In function `sim_switch_init': src/simtrace/sim_switch.c:69: multiple definition of `stats' src/simtrace/iso7816_uart.o(.bss.stats+0x0):src/simtrace/iso7816_uart.c:668: first defined here src/simtrace/spi_flash.o(.bss.stats+0x0): In function `spiflash_id': src/simtrace/spi_flash.c:137: multiple definition of `stats' src/simtrace/iso7816_uart.o(.bss.stats+0x0):src/simtrace/iso7816_uart.c:668: first defined here src/simtrace/main_simtrace.o(.bss.stats+0x0): In function `_main_func': src/simtrace/main_simtrace.c:220: multiple definition of `stats' src/simtrace/iso7816_uart.o(.bss.stats+0x0):src/simtrace/iso7816_uart.c:668: first defined here collect2: ld returned 1 exit status make: *** [main_simtrace.elf] Error 1 With CodeSourceryARM-toolchain: Linking: main_simtrace.elf arm-none-eabi-gcc -mcpu=arm7tdmi -I. -gdwarf-2 -DRUN_FROM_ROM -D__MS_types__ -D__LIBRFID__ -DDEBUG -DSIMTRACE -D__AT91SAM7S128__ -Isrc/simtrace -Iinclude -Isrc -O2 -Wall -Wextra -Wcast-align -Wimplicit -Wunused -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type - Wshadow -Wbad-function-cast -Wsign-compare -Waggregate-return -Wa,-adhlns=src/start/Cstartup_app.lst -I../../librfid//include/ -ffunction-sections -fdata-sections -MD -MP -MF .dep/main_simtrace.elf.d src/start/Cstartup_app.o lib/changebit.o lib/clearbit.o lib/setbit.o lib/testchangebit.o lib/testclearbit.o lib/testsetbit.o lib/lib1funcs.o lib/div64.o lib/lib_AT91SAM7.o lib/vsprintf.o lib/ctype.o lib/string.o src/os/pcd_enumerate.o src/os/fifo.o src/os/dbgu.o src/os/led.o src/os/req_ctx.o src/os/trigger.o src/os/main.o src/os/syscalls.o src/os/usb_handler.o src/os/usb_benchmark.o src/os/tc_cdiv.o src/os/pit.o src/os/pwm.o src/os/pio_irq.o src/os/usbcmd_generic.o src/os/wdt.o src/os/blinkcode.o src/os/system_irq.o src/os/flash.o src/simtrace/iso7816_uart.o src/simtrace/tc_etu.o src/simtrace/sim_switch.o src/simtrace/spi_flash.o src/simtrace/main_simtrace.o --output main_simtrace.elf -nostartfiles -Wl,-Map=main_simtrace.map,--cref -lc -lgcc -L../../librfid//src/.libs/ -Wl,--gc-sections -Wl,--entry=_startup -Tlink/AT91SAM7S128-ROM-sam7dfu-app.ld /root/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin/../lib/gcc/arm-none-eabi/4.6.1/libgcc.a(_udivsi3.o): In function `__aeabi_uidiv': (.text+0x0): multiple definition of `__udivsi3' lib/lib1funcs.o:/root/openpcd/firmware/lib/lib1funcs.S:183: first defined here /root/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin/../lib/gcc/arm-none-eabi/4.6.1/libgcc.a(_udivsi3.o): In function `__aeabi_uidiv': (.text+0x0): multiple definition of `__aeabi_uidiv' lib/lib1funcs.o:/root/openpcd/firmware/lib/lib1funcs.S:183: first defined here collect2: ld returned 1 exit status make: *** [main_simtrace.elf] Error 1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at freyther.de Fri Apr 6 08:33:42 2012 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Fri, 06 Apr 2012 10:33:42 +0200 Subject: Unable to compile firmware In-Reply-To: References: Message-ID: <4F7EAA66.4030905@freyther.de> On 04/05/2012 06:55 PM, Marnix Janse wrote: > Greetings to you all. Hi, please don't send emails as HTML. You picked a font size I can not read. cheers holger From holger at freyther.de Fri Apr 6 09:02:41 2012 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Fri, 06 Apr 2012 11:02:41 +0200 Subject: Unable to compile firmware In-Reply-To: References: Message-ID: <4F7EB131.1010403@freyther.de> On 04/05/2012 06:55 PM, Marnix Janse wrote: > Greetings to you all. Hi again, > Can anyone point me in the right direction on what toolchain to use and help > me with the make-ussues below? I will extend the manual to point to the wiki page. Right now the best option is to build an arm-elf (no linux) toolchain yourself. This page[1] has a script that should help you to generate a working toolchain. [1] http://bb.osmocom.org/trac/wiki/GnuArmToolchain PS: Thunderbird didn't allow me to see the plain text version, sorry about that, your email was fine. From peter at stuge.se Fri Apr 6 23:35:29 2012 From: peter at stuge.se (Peter Stuge) Date: Sat, 7 Apr 2012 01:35:29 +0200 Subject: Unable to compile firmware In-Reply-To: References: Message-ID: <20120406233529.4558.qmail@stuge.se> Marnix Janse wrote: > - I tried: > > - Linux-builds: CentOS 6.2 64-bitsVM, a CentOS 6.2 32-bitsVM > and finally an Ubuntu 11.10 32-bits VM. > - ARM-toolchain: GNU-arm (from the Wiki) and the CodeSourcery > (advised at the openpcd website) It shouldn't take that much effort actually. Hm. Anyway. Did you clean your build directory thoroughly between each toolchain switch? Otherwise you are mixing binary object files and that has about zero chance of working out. //Peter From marnix.janse at gmail.com Sat Apr 7 08:03:55 2012 From: marnix.janse at gmail.com (Marnix Janse) Date: Sat, 7 Apr 2012 10:03:55 +0200 Subject: Unable to compile firmware In-Reply-To: <20120406233529.4558.qmail@stuge.se> References: <20120406233529.4558.qmail@stuge.se> Message-ID: <1995A44B-9DC2-42B9-86C2-03F99F8DD59D@gmail.com> On 7 apr. 2012, at 01:35, Peter Stuge wrote: > It shouldn't take that much effort actually. Hm. > > Anyway. Did you clean your build directory thoroughly between each > toolchain switch? Otherwise you are mixing binary object files and > that has about zero chance of working out. Well, I like to rule out my errors before asking for help. Between every build attempts I ran "make clean". The current status is that on Ubuntu 11.10 the GNUarm from the wiki worked. Firmware was loaded via sam7. (I have 1.1p revision hw, took a while before it was in SAM-BA-mode) The device is in DFU-mode when you see this in dmesg: usb 2-2.2: new full speed USB device number 7 using uhci_hcd cdc_acm 2-2.2:1.0: This device cannot do calls on its own. It is not a modem. cdc_acm 2-2.2:1.0: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters The first traces were made succesfully via tcpdump. Wireshark shows the GSM11.11 packets as corrupted data. Decoding up to GSM11.11 layer is fine. This is sometning I will probably figure out myself, but any hints are welcome. NFC-tests are part of my work package, but it looks like the board requires some shielding. The 13MHz antennas seem to disturb the operation on the simtrace-boad. Will find a solution and report back to the community. Marnix From holger at freyther.de Sat Apr 7 08:17:18 2012 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Sat, 07 Apr 2012 10:17:18 +0200 Subject: Unable to compile firmware In-Reply-To: <1995A44B-9DC2-42B9-86C2-03F99F8DD59D@gmail.com> References: <20120406233529.4558.qmail@stuge.se> <1995A44B-9DC2-42B9-86C2-03F99F8DD59D@gmail.com> Message-ID: <4F7FF80E.8060107@freyther.de> On 04/07/2012 10:03 AM, Marnix Janse wrote: > > The device is in DFU-mode when you see this in dmesg: s/DFU/SAM-BA/ Out of curiosity, were you forced to use SAM-BA? Somehow our expectation is that SAM-BA is only used as last resort. > NFC-tests are part of my work package, but it looks like the board requires > some shielding. The 13MHz antennas seem to disturb the operation on the > simtrace-boad. Will find a solution and report back to the community. We had this topic at the OsmoDevCon2012 and the mentioned solution was: "NFC and SIMtrace FPC... interference... 13..Mhz NFC magnetic coupling -> use copper tape as shielding" holger From holger at freyther.de Sat Apr 7 11:16:44 2012 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Sat, 07 Apr 2012 13:16:44 +0200 Subject: Unable to compile firmware In-Reply-To: <4F7EB131.1010403@freyther.de> References: <4F7EB131.1010403@freyther.de> Message-ID: <4F80221C.4090909@freyther.de> On 04/06/2012 11:02 AM, Holger Hans Peter Freyther wrote: > > I will extend the manual to point to the wiki page. Right now the best option I updated the manual, as usual proof reading, spelling fixes, etc are much appreciated. holger From zecke at selfish.org Sat Apr 7 17:48:17 2012 From: zecke at selfish.org (Holger Hans Peter Freyther) Date: Sat, 7 Apr 2012 19:48:17 +0200 Subject: [PATCH] eabi: Remove EABI functions to fix building with EABI toolchains Message-ID: <1333820897-20430-1-git-send-email-zecke@selfish.org> These symbols are not referenced on an arm-elf gcc 4.7, they are used when building with an arm-eabi gcc 4.7 and then cause linking issues. The linking to libgcc can not be omitted as the irq code is using ffs. Remove the EABI symbols. The alternative would be to declare the EABI as weak inside the lib1funcs. Link error: multiple definition of `__udivsi3' multiple definition of `__aeabi_uidiv' Exported symbols: nm lib/lib1funcs.o 00000000 t Ldiv0 00000010 T __div0 --- firmware/lib/lib1funcs.S | 99 ---------------------------------------------- 1 file changed, 99 deletions(-) diff --git a/firmware/lib/lib1funcs.S b/firmware/lib/lib1funcs.S index 92a6c56..87890db 100644 --- a/firmware/lib/lib1funcs.S +++ b/firmware/lib/lib1funcs.S @@ -205,105 +205,6 @@ Boston, MA 02111-1307, USA. */ .endm -ENTRY(__udivsi3) -ENTRY(__aeabi_uidiv) - - subs r2, r1, #1 - moveq pc, lr - bcc Ldiv0 - cmp r0, r1 - bls 11f - tst r1, r2 - beq 12f - - ARM_DIV_BODY r0, r1, r2, r3 - - mov r0, r2 - mov pc, lr - -11: moveq r0, #1 - movne r0, #0 - mov pc, lr - -12: ARM_DIV2_ORDER r1, r2 - - mov r0, r0, lsr r2 - mov pc, lr - - -ENTRY(__umodsi3) - - subs r2, r1, #1 @ compare divisor with 1 - bcc Ldiv0 - cmpne r0, r1 @ compare dividend with divisor - moveq r0, #0 - tsthi r1, r2 @ see if divisor is power of 2 - andeq r0, r0, r2 - movls pc, lr - - ARM_MOD_BODY r0, r1, r2, r3 - - mov pc, lr - - -ENTRY(__divsi3) -ENTRY(__aeabi_idiv) - - cmp r1, #0 - eor ip, r0, r1 @ save the sign of the result. - beq Ldiv0 - rsbmi r1, r1, #0 @ loops below use unsigned. - subs r2, r1, #1 @ division by 1 or -1 ? - beq 10f - movs r3, r0 - rsbmi r3, r0, #0 @ positive dividend value - cmp r3, r1 - bls 11f - tst r1, r2 @ divisor is power of 2 ? - beq 12f - - ARM_DIV_BODY r3, r1, r0, r2 - - cmp ip, #0 - rsbmi r0, r0, #0 - mov pc, lr - -10: teq ip, r0 @ same sign ? - rsbmi r0, r0, #0 - mov pc, lr - -11: movlo r0, #0 - moveq r0, ip, asr #31 - orreq r0, r0, #1 - mov pc, lr - -12: ARM_DIV2_ORDER r1, r2 - - cmp ip, #0 - mov r0, r3, lsr r2 - rsbmi r0, r0, #0 - mov pc, lr - - -ENTRY(__modsi3) - - cmp r1, #0 - beq Ldiv0 - rsbmi r1, r1, #0 @ loops below use unsigned. - movs ip, r0 @ preserve sign of dividend - rsbmi r0, r0, #0 @ if negative make positive - subs r2, r1, #1 @ compare divisor with 1 - cmpne r0, r1 @ compare dividend with divisor - moveq r0, #0 - tsthi r1, r2 @ see if divisor is power of 2 - andeq r0, r0, r2 - bls 10f - - ARM_MOD_BODY r0, r1, r2, r3 - -10: cmp ip, #0 - rsbmi r0, r0, #0 - mov pc, lr #ifdef CONFIG_AEABI -- 1.7.9.5 From peter at stuge.se Sun Apr 8 01:24:45 2012 From: peter at stuge.se (Peter Stuge) Date: Sun, 8 Apr 2012 03:24:45 +0200 Subject: [PATCH] eabi: Remove EABI functions to fix building with EABI toolchains In-Reply-To: <1333820897-20430-1-git-send-email-zecke@selfish.org> References: <1333820897-20430-1-git-send-email-zecke@selfish.org> Message-ID: <20120408012445.23279.qmail@stuge.se> Holger Hans Peter Freyther wrote: > These symbols are not referenced on an arm-elf gcc 4.7, they are > used when building with an arm-eabi gcc 4.7 and then cause linking > issues. The linking to libgcc can not be omitted as the irq code is > using ffs. Remove the EABI symbols. The alternative would be to > declare the EABI as weak inside the lib1funcs. Acked-by: Peter Stuge From laforge at gnumonks.org Sun Apr 8 08:01:42 2012 From: laforge at gnumonks.org (Harald Welte) Date: Sun, 8 Apr 2012 10:01:42 +0200 Subject: [PATCH] eabi: Remove EABI functions to fix building with EABI toolchains In-Reply-To: <1333820897-20430-1-git-send-email-zecke@selfish.org> References: <1333820897-20430-1-git-send-email-zecke@selfish.org> Message-ID: <20120408080142.GC10833@prithivi.gnumonks.org> On Sat, Apr 07, 2012 at 07:48:17PM +0200, Holger Hans Peter Freyther wrote: > These symbols are not referenced on an arm-elf gcc 4.7, they are thanks, applied. -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)