Hi,
I work with an LPC3250 board. i try to write a "long int" value into the SDRAM at address X through a "long int *" pointer. but the value will be written at address (X-2). if I write into the RAM in the same way or if write the value Byte by Byte into the SDRAM there are no problems detected. Any help would be extremely appreciated
"...but the value will be written at address (X-2)."
This will almost certainly be due to a problem with the dynamic memory interface configuration and a mismatch of that with the actual hardware.
DJR
In all likelihood the address X is not aligned to a four-byte boundary. This is called unaligned access. The behaviour you are seeing is to be expected. Depending on what you are trying to do, there different ways of dealing with the problem: a) Do not create unaligned data. b) If a) can't be avoided, access the data in smaller chunks (bytes, half-words). c) If a) can't be avoided, use compiler extensions to access unaligned data (the packed keyword). Naturally, this will limit portability.
"In all likelihood the address X is not aligned to a four-byte boundary."
It appears I jumped in too soon with an answer :(
Mike is likely to be right with what he says.
Hi Mike is right the address X is not aligned to a four-byte boundary. thank you for your attention.