Integer getting placed at address not divisible by 4

OP #1174365
Details: i am using Atmel's AT91SAM7X256-EK board

Compiler: IAR 5.11

Problem Summary: An 32 bit structure member int (uint32_t) is getting
placed in the memory at an adress which is not divisible by 4. Hence an
abort execption is getting generated due to misaligned read access.

Do i have to use any compiler setting to avoid this?

According to my knowledge, in an ARM 7 processor, a data type will
always be placed at a memory location which is divisible by the size of
that data type.
OP #1174366
Vinit Bidkar wrote:
> Details: i am using Atmel's AT91SAM7X256-EK board
>
> Compiler: IAR 5.11
>
> According to my knowledge, in an ARM 7 processor, a data type will
> always be placed at a memory location which is divisible by the size of
> that data type.

Additonal information:

The above mentioned structure pointer is typecasted to an array pointer.
When i create a local instance of the structure then there in problem of
misalignment.
OP #1174367
Vinit Bidkar wrote:
> Vinit Bidkar wrote:
>> Details: i am using Atmel's AT91SAM7X256-EK board
>>
>> Compiler: IAR 5.11
>>
>> According to my knowledge, in an ARM 7 processor, a data type will
>> always be placed at a memory location which is divisible by the size of
>> that data type.
>
> Additonal information:
>
> The above mentioned structure pointer is typecasted to an array pointer.
> When i create a local instance of the structure then there in problem of
> misalignment.

Typo
When i create a local instance of the structure then there no problem of
misalignment.

Reply

A question of your own? This thread is over 18 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.