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 of variables for Cortex-M0
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
2 replies
Subscribers
126 subscribers
Views
3458 views
Users
0 members are here
Related
Alignment of variables for Cortex-M0
Offline
Alistair Lowe
over 7 years ago
Note: This was originally posted on 12th October 2012 at http://forums.arm.com
[font=verdana, sans-serif][size=2]Hi guys,[/size][/font]
[font=verdana, sans-serif][size=2]I'm currently working with a Cortex-M0 (using armcc), which is incapable of unaligned reads.[/size][/font]
[font=verdana, sans-serif][size=2]I have a byte array which is storing a received packet in a certain protocol, the first lot of information to come in is 1 byte, followed by two 16-bit half-words.[/size][/font]
[font=verdana, sans-serif][size=2]This is leading to misalignment and preventing me from performing any direct casting/pointer access to these values; I can't space the data out as it's being placed in the array by DMA.[/size][/font]
[font=verdana, sans-serif][size=2]I know with a structure it can be packed, however I've had no such luck with pointers and access to my array.[/size][/font]
[font=verdana, sans-serif][size=2]Is it possible to ask the compiler to align the start of my byte array on the edge of a word (3 bytes), so that the rest of my data is aligned? And if so how?[/size][/font]
[font=verdana, sans-serif][size=2]Any other suggestions?[/size][/font]
[font=verdana, sans-serif][size=2]Many thanks for any help and advice.[/size][/font]
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
Answered
How to view SFRs in DS during debugging?
+1
2878
views
1
reply
Latest
3 months ago
by
Ronan Synnott
Answered
Dual-core debugging in DS
0
5733
views
2
replies
Latest
3 months ago
by
Ivan Savvateev
Answered
DS52020.0 connection to Musca-A/B boards not working
+1
Arm Development Studio
Musca-A
7529
views
4
replies
Latest
3 months ago
by
Daniel Oliveira
Answered
Positioning a function in a Position Independent Executable for ARMV8
+1
8284
views
3
replies
Latest
4 months ago
by
Stephen Theobald
Answered
Link a pure binary file to image with scatter file
0
8248
views
3
replies
Latest
4 months ago
by
Ronan Synnott
<
>
View all questions in Arm Development Studio forum