Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

Strange Assembler Error from AT91 USBSample.c

Posted by Nobody/Anonymous on June 28, 2005
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

RE: Strange Assembler Error from AT91 USBSample.c

Posted by Nobody/Anonymous on June 28, 2005
I beleieve the relevant compiler output in this area is:

.L5:
ldrr3, .L6+12
LDRR0, [r3, #0]
LDRLR, [R0]
LDRR0, =ulCriticalNesting
LDMFDLR!, {R1}
STRR1, [R0]
LDMFDLR!, {R0}
MSRSPSR, R0
LDMFDLR, {R0-R14}^
NOP
LDRLR, [LR, #+60]
SUBSPC, LR, #4
ldrr3, .L6+16
ldrr3, [r3, #0]
movr3, #-2147483648
movr3, r3, asr #19
movr2, #0
strr2, [r3, #304]
subsp, fp, #12
ldmfdsp, {fp, sp, pc}
.L7:
.align2
.L6:
.wordulNextMessage.0
.wordxISRMessages
.wordxUSBInterruptQueue
.wordpxCurrentTCB
.wordulCriticalNesting
.sizevUSB_ISR, .-vUSB_ISR
.align2

RE: Strange Assembler Error from AT91 USBSample.c

Posted by Nobody/Anonymous on June 28, 2005
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:
ldrr3, .L6+12
LDRR0, [r3, #0]
LDRLR, [R0]
LDRR0, =ulCriticalNesting
LDMFDLR!, {R1}
STRR1, [R0]
LDMFDLR!, {R0}
MSRSPSR, R0
LDMFDLR, {R0-R14}^
NOP
LDRLR, [LR, #+60]
SUBSPC, LR, #4
ldrr3, .L6+16
ldrr3, [r3, #0]
movr3, #-2147483648
movr3, r3, asr #19
movr2, #0
strr2, [r3, #304]
subsp, fp, #12
ldmfdsp, {fp, sp, pc}
.L7:
.align2
.L6:
.wordulNextMessage.0
.wordxISRMessages
.wordxUSBInterruptQueue
.wordpxCurrentTCB
.wordulCriticalNesting
.sizevUSB_ISR, .-vUSB_ISR
.align2

Shannon

RE: Strange Assembler Error from AT91 USBSample.c

Posted by Richard on June 28, 2005
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 don’t 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 don’t 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 don’t 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.

RE: Strange Assembler Error from AT91 USBSample.c

Posted by Shannon Holland on June 28, 2005
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

RE: Strange Assembler Error from AT91 USBSample.c

Posted by Shannon Holland on June 30, 2005
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

RE: Strange Assembler Error from AT91 USBSample.c

Posted by Richard on June 30, 2005
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.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner