Andes Workshop

the message "Unhandled unaligned access exception"
Page 1 of 1

Author:  cindy [ Thu Apr 28, 2011 5:40 pm ]
Post subject:  the message "Unhandled unaligned access exception"

Q:We also found the message "Unhandled unaligned access exception"
appears when we load Linux kernel module.
Shall we need to consider the alignment issue in our code or your
compiler will deal with this issue?

A:Andes compiler和x86不同,我們不會自動處理unaligned的情況。
開機之後,在command line裡下這個command,
echo “7” > /proc/cpu/alignment
再insert module

Q:We have tried it, but the message disappears but the following new message "_do_unaligned_access" appears and then the kernel crashes.
Please also refer to the attachment and give us some suggestion.

A: "_do_unaligned_access" 因為在build kernel時,必須要打開unalignment handler。
Build kernel時,在System type->最下方的kernel support unaligned access handling

unaligned.gif [ 26.08 KiB | Viewed 11443 times ]

PS. 編Linux Kernel時要記得加上環境變數
$ export ARCH=nds32 CROSS_COMPILE=nds32le-linux-
這樣子System type的選項才會出現。
詳細的編譯步驟可以看BSP v3.0.0

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group