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
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
Alignment in Cortex-M3 and RVDS
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
2 replies
Subscribers
126 subscribers
Views
2231 views
Users
0 members are here
Related
Alignment in Cortex-M3 and RVDS
Offline
Sagar Jadhav
over 7 years ago
Note: This was originally posted on 6th May 2011 at http://forums.arm.com
Hi all,
I am using RVDS 4.1 for debugging a Corex-M3 based target. I am facing an alignment issue. My code is making 2-byte as well as 4-byte aligned access. I want it to make only 4-byte aligned access.
1. Can anyone tell me how I can find out whether program is making or not a 4-byte aligned access(of instruction or data)?
2. Can i know whether a function (in disassembly) or a section in scatter loading file is 4-byte aligned or not??
3. Can you suggest anything i can make use of in my scatter loading file (I am using 'ALIGNALL 4' option for a few regions, but randomly)??
4. Also, which instruction set does Cortex-M3 use - ARM or THUMB or THUMB-2 or any combination of these 3?
Thanks,
Sagar.
Offline
Sagar Jadhav
over 7 years ago
Note: This was originally posted on 27th May 2011 at
http://forums.arm.com
Hey Joseph,
Thanks a lot for answering my queries.
Regards,
Sagar Jadhav.
Cancel
Up
0
Down
Reply
Cancel
Offline
Joseph Yiu
over 7 years ago
Note: This was originally posted on 13th May 2011 at
http://forums.arm.com
1. For instructions in Cortex-M3, it can be 2 bytes in size or 4 bytes in size. Therefore the instructions can be in 4 bytes or 2 bytes aligned locations. The actual instruction fetches are always 4 bytes in size and aligned to 4 byte address boundaries.
Data in ARM can be byte, halfword (2 bytes), word (4 bytes) or even double word ( 8 bytes). Cortex-M3 can generate accesses based on the data size (except for double word data, which is handled with multiple accesses on the bus).
Normally data transfers are aligned to size, unless you directly setting up pointers in C to create unaligned data, or use pack structures.
The Cortex-M3 can be setup to detect unaligned transfer by setting UNALIGN_TRP (bit 3) of Configuration Control Register (@0xE000ED14). However, this is a bit different from your question of "find out whether program is making or not a 4-byte aligned access(of instruction or data)".
4. Cortex-M3 is Thumb only, and support both 16-bit and 32-bit Thumb instructions. The supports of this mixing of 16-bit and 32-bit instructions is called Thumb-2 Technology.
I don't have answer for question 2 and 3 at the moment.
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
ARM development studio with ARM Juno r2 board
0
Juno Arm Development Platform
Arm Development Studio
Products
Arm Support
9042
views
2
replies
Latest
5 months ago
by
Ronan Synnott
Answered
"Unable to execute remote query (response code 503) " issue
0
8678
views
1
reply
Latest
5 months ago
by
Ronan Synnott
Answered
Where can I download DS-5 hardware firmware??
+1
8119
views
1
reply
Latest
5 months ago
by
Ronan Synnott
Not Answered
freeRTOS demo DS-5 ERROR(CMD360) when trying to debug
+1
13417
views
12
replies
Latest
6 months ago
by
tolc
Answered
ubuntu - How to uninstall Arm Development studio and all its requirements
0
Arm Development Studio
9065
views
1
reply
Latest
6 months ago
by
Jonathan Simmonds
<
>
View all questions in Arm Development Studio forum