Strange Assembler Error from AT91 USBSample.c

Hello, I’m trying to get the GCC AT91SAM7S GCC port building and am hitting a strange error in USBSample.c I’ve tried using both GCC 4.0.0 and 3.4.3, both with the same result. The error is from within the portEXIT_SWITCHING_ISR macro. The actual message is: $ make arm-elf-gcc -c  -Wall -DSAM7_GCC -I. -I../../Source/include -I../../Source/portable/GCC/ARM7_AT91SAM 7S -I../Common/include  -mcpu=arm7tdmi -Trtosdemo-rom.ld -Wcast-align  -g USB/USBSample.c -o USB/USB Sample.o In file included from ./board.h:21,                  from USB/USBSample.c:68: ../../Source/portable/GCC/ARM7_AT91SAM7S/lib_AT91SAM7S64.h:34:1: warning: "__inline" redefined In file included from USB/USBSample.c:68: ./board.h:20:1: warning: this is the location of the previous definition USB/USBSample.c: In function `vInitUSBInterface’: USB/USBSample.c:1128: warning: unused variable `ulTemp’ /cygdrive/c/DOCUME~1/SHANNO~1/LOCALS~1/Temp/ccDKnKZO.s: Assembler messages: /cygdrive/c/DOCUME~1/SHANNO~1/LOCALS~1/Temp/ccDKnKZO.s:439: Error: invalid literal constant: pool ne eds to be closer make: *** [USB/USBSample.o] Error 1 What exactly does this mean and how might I fix it? Thank you! Shannon

Strange Assembler Error from AT91 USBSample.c

I beleieve the relevant compiler output in this area is: .L5:     ldr    r3, .L6+12     LDR        R0, [r3, #0]     LDR        LR, [R0]     LDR        R0, =ulCriticalNesting     LDMFD    LR!, {R1}     STR        R1, [R0]     LDMFD    LR!, {R0}     MSR        SPSR, R0     LDMFD    LR, {R0-R14}^     NOP     LDR        LR, [LR, #+60]     SUBS    PC, LR, #4     ldr    r3, .L6+16     ldr    r3, [r3, #0]     mov    r3, #-2147483648     mov    r3, r3, asr #19     mov    r2, #0     str    r2, [r3, #304]     sub    sp, fp, #12     ldmfd    sp, {fp, sp, pc} .L7:     .align    2 .L6:     .word    ulNextMessage.0     .word    xISRMessages     .word    xUSBInterruptQueue     .word    pxCurrentTCB     .word    ulCriticalNesting     .size    vUSB_ISR, .-vUSB_ISR     .align    2

Strange Assembler Error from AT91 USBSample.c

Hmmm, I just posted a reply to my first message, but apparently wasn’t logged in… Here it is again. I dumped the assembler output from the compiler (gcc3.4.3 in this case). I believe this is the relevant section: .L5:     ldr    r3, .L6+12     LDR        R0, [r3, #0]     LDR        LR, [R0]     LDR        R0, =ulCriticalNesting     LDMFD    LR!, {R1}     STR        R1, [R0]     LDMFD    LR!, {R0}     MSR        SPSR, R0     LDMFD    LR, {R0-R14}^     NOP     LDR        LR, [LR, #+60]     SUBS    PC, LR, #4     ldr    r3, .L6+16     ldr    r3, [r3, #0]     mov    r3, #-2147483648     mov    r3, r3, asr #19     mov    r2, #0     str    r2, [r3, #304]     sub    sp, fp, #12     ldmfd    sp, {fp, sp, pc} .L7:     .align    2 .L6:     .word    ulNextMessage.0     .word    xISRMessages     .word    xUSBInterruptQueue     .word    pxCurrentTCB     .word    ulCriticalNesting     .size    vUSB_ISR, .-vUSB_ISR     .align    2 Shannon

Strange Assembler Error from AT91 USBSample.c

Hi, There is actually no official SAM7 GCC port currently.  It is not documented and is not mentioned anywhere on the WEB site. The files in the source/portable/gcc/ARM7_AT91SAM7S directory were created for use with the Rowley CrossStudio tools  a (very nice) IDE for the GCC ARM7 compiler.  While this port is compiling it has not yet been downloaded onto the target for any testing.  I intend to return to and complete this port in the future  hence I left it in the source tree but dont reference it anywhere.  I think this was a mistake on my part as you are the second person in two days to use it.  Also the Rowley tools use their own linker/project files so there is no GCC compatable versions for this port. Having said that, I will be happy to assist where I can to get it going, but please understand that I cannot support it fully at the moment.  There should not be anything particularly new in the files as they are a combination of other ARM7 GCC ports along with the hardware setup from the IAR SAM7 port. As to what the problem is  very unhelpfully, I dont know!  There is nothing obviously wrong.  The asm output has the line: mov r3, #-2147483648 which does not look correct, but this is off the bottom of the portEXIT_SWITCHING_ISR() macro so I dont know where it comes from. A couple of suggestions: 1) You start with the AT91 GCC port and adapt this for the SAM7.  This would allow you to start with the latest build of code (3.1.1) and a working Atmel SAM7 port.  The SAM7 GCC files are not up to the latest standard  for example portBASE_TYPE is not defined. or 2) If you could zip up your entire project (makefiles, linker scripts, etc.) and send them to me (email address form the contacts page of the WEB site), then I could take a look. Regards.

Strange Assembler Error from AT91 USBSample.c

Yeah, I figured it wasn’t quite done yet – had noticed it wasn’t listed on the site and was surprised to see it there. I was very happy to see it though – was expecting to start from scratch! I did make some changes to get it to compile (added portBASE_TYPE, etc). I also merged in some of the changes (makefile, etc) from the AT91FR40008 GCC port. I think the mov r3, #-2147483648  is acutally valid. The last line in the ISR function is "AT91C_BASE_AIC->AIC_EOICR = 0", gcc is just being tricky when building the address (so this is after the macro). Interestingly, only the USB isr fails this way, the serial isr seems to be fine. Also, if I break the cpu here and make it do the right thing through the code (well, I had to mess with it a bit to get it to compile) I can get it to run, for a little bit at least. I’ll keep working with it – think I’m close. Thanks! Shannon

Strange Assembler Error from AT91 USBSample.c

OK, I was able to get this working. Few errors in various places – mostly difference in IAR versus GCC. I moved my changes over to 3.2.0. Shall I email you a zip file with allof my changes? Shannon

Strange Assembler Error from AT91 USBSample.c

Yes please – I would like to see what changes were necessary. Please use the r dot barry at fre…… email address from the contact page of the WEB site rather than the sourceforge address (attachments will get stripped). Thanks.