I have some question about memcpy?
when i use memcpy with STM32F4,i wanna copy some data to structure in other data(copy data size 16byte), but however i used microlib or not this memcpy translation by keil,i see this thumb code become STRD r1,r12,[r2,#0x08] ,but R2 reg is 0x20017977 is a not word align. R2 reg number is memcpy Dst addr.When i use memcpy like "memcpy(0x20017977,(u8*)Src_addr,16)" i see translation thumb code use "__aeabi__memcpy(0x080001E4)",that`s all right.
so, I want know whey Armcc translation code do this?And How can i safe use when i use memcpy funcation?
This provides a good explanation.
I would agree there is a stellar amount of stupidity making memcpy() fault on unaligned data, it used to be the default method of pulling unaligned data into aligned local variables on old ARM7/ARM9 boards.
There are occasions when you want memcpy() to be fast, but most need it to be safe.
Thanks for u answer the question.thanks~!
View all questions in Keil forum