support of unaligned data access
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2009-01-08 6:40 PM
Posted on January 09, 2009 at 03:40
support of unaligned data access
This discussion is locked. Please start a new topic to ask your question.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:31 AM
Posted on May 17, 2011 at 12:31
Hi
Are there any C compiler which supports the unaligned data access of the Cortex-M3 core? Right now I am using the Keil RVMDK. It seems that I have to use the __packed keyword for each variable, structure... to get unaligned data access but how do I get unaligned data access for a entire project? Are there better solutions than using the __packed keyword?Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:31 AM
Posted on May 17, 2011 at 12:31
FWIW, LDM/STM do not work unless word aligned. I suspose that its someplace in some doc file. 'Twaz a pain to rewrite to assure aligned load/store multiple.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:31 AM
Posted on May 17, 2011 at 12:31
From the armv7 docs:
The following data accesses always generate an alignment fault: • Non halfword-aligned LDREXH and STREXH • Non word-aligned LDREX and STREX • Non word-aligned LDRD, LDM{IA}, LDMDB, POP, and LDC • Non word-aligned STRD, STM{IA}, STMDB, PUSH, and STC. The following data accesses support unaligned addressing, and only generate alignment faults when the CCR.UNALIGN_TRP bit is set (see The System Control Block (SCB) on page B2-7): • Non halfword-aligned LDRH, LDRHT, LDRSH, LDRSHT, STRH and STRHT • Non halfword-aligned TBH • Non word-aligned LDR{T} and STR{T}. Cheers SpenOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:31 AM
Posted on May 17, 2011 at 12:31
Hi there,
Why do you want unaligned data to be supported on all variables? If the data elements in data structures are arranged carefully, you won't be wasting memory space anyway. JosephOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:31 AM
Posted on May 17, 2011 at 12:31
Hi
Thanks for the feedbacks. Additional information about this topic could be found at the cross-post on the Keil forum. http://www.keil.com/forum/docs/thread13940.asp#msg69667 Regards