Unaligned memory access through pointer in cortex-m3




Hi friends,
I am using stellaris LM3s6965 micro-controller, Keil (MDK-ARM 4.20) as
IDE.

I want to know the alignment restrictions on using pointer of
following type.

Uint8_t * (unsigned char 8-bit)
Uint16_t * (unsigned 16-bit)
Uint32_t * (unsigned 32-bit)

I need to access 32-bit or 16-bit data from a memory buffer. There is
no guarantee that address will be aligned. In this case what should I
do?


Thanks & regards,
Kishore.
.



Relevant Pages

  • Re: Unaligned memory access through pointer in cortex-m3
    ... IDE. ... I want to know the alignment restrictions on using pointer of ...  I need to access 32-bit or 16-bit data from a memory buffer. ...
    (comp.arch.embedded)
  • Re: BIOS problem?
    ... It becomes /dev/sda and the IDE becomes /dev/sdb. ... Soon it will be F7 64 bit new install. ... I managed to get a terminal down and mounted this Linux and found what fixed the pointer on this and put it in the new 64 bit machine, ... Now the grub in the F7/64 put the setup in /dev/sdb4 which is very odd since it wound up being the first disk. ...
    (Fedora)
  • Re: [JW] alignment problem for structures
    ... > I'm talking about alignment in the context of 6.3.2.3p7: ... > pointer to a different object or incomplete type. ... pointer to some other pointer type and back, the second conversion produces ... because char doesn't have alignment restrictions. ...
    (comp.std.c)
  • Re: pointer alignment
    ... > A char has no alignment restrictions. ... A pointer to char may. ... allowing the program to run with a severe penalty hit. ...
    (comp.lang.c)
  • Re: [JW] alignment problem for structures
    ... > But since a pointer to one-past-one doesn't point to an object, ... pointer to a different object or incomplete type. ... "correctly aligned" is to be consistent with the alignment restrictions ...
    (comp.std.c)