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
Not Answered
Forum FAQs
0
ARM Community
904
views
0
replies
Started
4 days ago
by
Annie Cracknell
Suggested Answer
How to view SFRs in DS during debugging?
0
246
views
1
reply
Latest
1 day ago
by
Ronan Synnott
Answered
Dual-core debugging in DS
0
3171
views
2
replies
Latest
13 days ago
by
Ivan Savvateev
Answered
Failure to get an evaluation license with error Unable to execute API call /api/v1/connect
0
4106
views
3
replies
Latest
19 days ago
by
Tim Holt
Suggested Answer
DS52020.0 connection to Musca-A/B boards not working
0
Arm Development Studio
Musca-A
5144
views
4
replies
Latest
21 days ago
by
Daniel Oliveira
>
View all questions in Arm Development Studio forum