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
Failed to read contents of Internal RAM L1-I_DATA in ARM DS
0
Arm Development Studio
Cache
Debug and Trace Services Layer (DTSL)
13457
views
23
replies
Latest
4 months ago
by
Boon Khai
Answered
DS-5 connect fail when cortex-r5 is in lock-step mode
+1
11225
views
10
replies
Latest
5 months ago
by
Stuart Hirons
Answered
On Cortex-M4F microcontrollers: is fixed point math faster or floating point?
+1
10773
views
10
replies
Latest
5 months ago
by
Ronan Synnott
Answered
Debugging kernel: OS support not working for Linux 5.4
+1
Kernel Developers
External Hardware Debug
Debugger
9648
views
5
replies
Latest
5 months ago
by
sgoldschmidt
Answered
DS-5 bare metal wait error after run "debug"
+1
DS-5 Development Studio
Debugging
Arm Compiler 5
Memory
32543
views
14
replies
Latest
5 months ago
by
prasadghole
<
>
View all questions in Arm Development Studio forum