Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Pelion IoT Platform
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
Problems compiling assembly for cortex m3
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
4 replies
Subscribers
127 subscribers
Views
2387 views
Users
0 members are here
Related
Problems compiling assembly for cortex m3
Offline
Gestur Palsson
over 7 years ago
Note: This was originally posted on 20th February 2011 at http://forums.arm.com
Hi,
My platform is Stellaris Cortex M3 and I'm using one of the recent releases of Codesourcery Lite toolchain.
I'm trying to put an assembly source file to my project and edit my makefile to compile it along with all the *.c files.
My issue is that I'm getting the following error message, compiling the assembly file:
asmFile.s:235: Error: ARM register expected -- `ldrsh xi,[a,#2]'
Currently I'm configuring my compiler flags like this:
ASMFLAGS = -mthumb -mcpu=cortex-m3 -x assembler-with-cpp -adhlmns
The assembly file is using #define's for re-defining register names, as well as macros for some pre-defined actions.
I think I need some basic suggestions on how to configure my arm-none-eabi-gcc compiler, to compile and pre-process an assembly file.
Any hints on how to tweak the compiler to correctly compile my assembly?
Regards
palsson
Offline
Simon Craske
over 7 years ago
Note: This was originally posted on 21st February 2011 at
http://forums.arm.com
If you're using gcc rather than as; then a simple solution is just to rename the file from "asmFile.s" to "asmFile.S"
(note the capital .S), e.g.:
# arm-none-linux-gnueabi-gcc -c -mcpu=cortex-m3 -mthumb asmFile.S
hth
s.
Cancel
Up
0
Down
Reply
Cancel
Offline
Gestur Palsson
over 7 years ago
Note: This was originally posted on 22nd February 2011 at
http://forums.arm.com
Hi S,
Unfortunately, it is not that easy :-)
If I remove all macros and register re-definitions, #define's, it can compile.
So, I need hints on compiler flags to enable macros and register definitions (pre-processing)
Thanks...
Regards
palsson
Cancel
Up
0
Down
Reply
Cancel
Offline
Simon Craske
over 7 years ago
Note: This was originally posted on 22nd February 2011 at
http://forums.arm.com
Palsson,
Did you actually try my suggestion? GCC when given a file ending in a lower case ".s" just sends the file to GAS; if however it ends in a capital ".S", it sends it to CPP before sending it to GAS.
hth
s.
Cancel
Up
0
Down
Reply
Cancel
Offline
Gestur Palsson
over 7 years ago
Cancel
Up
0
Down
Reply
Cancel
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Suggested Answer
Positioning a function in a Position Independent Executable for ARMV8
0
5720
views
3
replies
Latest
1 month ago
by
Stephen Theobald
Answered
Link a pure binary file to image with scatter file
0
5676
views
3
replies
Latest
1 month ago
by
Ronan Synnott
Answered
Failed to read contents of Internal RAM L1-I_DATA in ARM DS
0
Arm Development Studio
Cache
Debug and Trace Services Layer (DTSL)
9915
views
23
replies
Latest
1 month ago
by
Boon Khai
Suggested Answer
DS-5 connect fail when cortex-r5 is in lock-step mode
0
8258
views
10
replies
Latest
2 months ago
by
Stuart Hirons
Suggested Answer
On Cortex-M4F microcontrollers: is fixed point math faster or floating point?
0
7927
views
10
replies
Latest
2 months ago
by
Ronan Synnott
<
>
View all questions in Arm Development Studio forum