we made some simple tests with STM32F100 Value Line Eval
static unsigned char sDstBuf; // 1KiB
static unsigned char sSrcBuf[sizeof(sDstBuf)];
printf("Copying words from misaligned src to aligned dst buffer...
memset(sDstBuf, 0xcd, sizeof(sDstBuf));
with optimize Level 3, optimize for time this takes
with optimize Level 0
almost the same if memcpy is used:
memcpy(sDstBuf, (const void *)0xcd, sizeof(sDstBuf));
It runs into hard fault, if optimize Level >=1 and optimise for
time is not set.
I think this is a compiler error..
We ran into this before with MDK 4.60, now we use 4.70A
You should set the compiler switch "--no_unaligned_access" in Keil
for Cortex M3/M4.(In fact it would be better, if it would be set by
default already ...).
ARM7 has the principal possibility to support access at 2-Byte
addresses for LDR and STR commands - but it is quite stupid, as it is
not faster than two 4-Byte (=32-bit aligned) accesses. So you should
switch this off in the compiler. (if you want to use it, you have to
switch it on in the CPU - see the "system ... .c" file - best search
for the keyword "aligned" in the ARM7 TRM / STM32F4 Programming
Manual / Cortex M4 TRM).
You should set the compiler switch "--no_unaligned_access" in
Keil for Cortex M3/M4.(In fact it would be better, if it would be set
by default already ...).
No, that's not what he should do.
What he should do is stop expecting a compiler to magically turn
badly flawed source code into working machine code. The problem here
is not in the compiler ... it's in that source code, because that
code wilfully disregards both the programming language's and the
target architecture's properties.
Who do you think you are directing your late response to?
Thread create time: 15-Apr-2013 07:41 GMT
Last post before your: 16-Apr-2013 18:37 GMT
(note that Keil servers normally never manages to show correct
time - they have incorrect code and/or configuration for used time
zone. They can't even show the same time stamp in the thread list as
for the individual posts.
But anyway: not a single post in this thread can be called "late
response" unless you consider the time of day when the poster made
the post. And that would be hard to do if you don't know exactly
where in the world they actually live.
And that would be hard to do if you don't know exactly where in
the world they actually live.
Err, no. A typical method of determining elapsed time is
End-Start. If you remembered the local time of day when the original
post appeared and you also know the local time of when a
condescending response appeared, you can then easily calculate the
delay in that condescending response.
If you did read my post, and pondered a bit, you wouldn't "err,
A large percent of threads on this forum runs for a number of
Look at the time stamps of first/last post here - this is a young
thread so _no_ answer here can be considered a late response.
Which was why I noted that the only way you could debate 'late'
was if someone posted it late at night. But that requires that you
know what time zone the person lives in.
You realize this is a web forum? Not a chat program where you get
a 'beep' or something in the mobile phone, and then instantly writes
View all questions in Keil forum