In below picture, ARM is going to load variable "UI_SPL_SensingMic" from within union "SPL_SensingMic".
ARM is going to do
1. get the base address from sp.
It makes sense. It's the base address of struct *(element).
2. load value from address 0x803657D2+8 to register s0.
The logic here is no problem.
3. After executing it, the arm goes to abort mode from supervisor.
quoted from ARM System Developers Guide-Designing and Optimizing System Software:
「Prefetch abort vector occurs when the processor attempts to fetch an instruction from an address without the correct access permissions. The actual abort occurs in the decode stage.」
「Data abort vector is similar to a prefetch abort but is raised when an instruction attempts to access data memory without the correct access permissions.」
I'm not sure, in this case, is this abort Prefetch or data?
And Why this happen?
Here is the compiler test case
"C:/ti/ccsv8/tools/compiler/ti-cgt-arm_5.2.5/bin/armcl" -mv7A8 --code_state=32 --float_support=VFPv3 --abi=eabi -me --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_5.2.5/include" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/uCOS Include" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include" --include_path="C:/ti/ccsv8/ATEIS AM335X/Source Code/Include/armv7a/am335x" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/NandFlash Include" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/lwip Include" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/FatSystem" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/MP3" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/OSIP" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/mmcsdlib" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/RTP" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/Lib_DSP_Math" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/Lib_DSP_Function" --include_path="C:/ti/ccsv8/ATEIS AM335X/Include/Lib_DSP_Filter" --include_path="C:/ti/ccsv8/ATEIS AM335X/Source Code/Include" --include_path="C:/ti/ccsv8/ATEIS AM335X/Source Code/Include/hw" --include_path="C:/ti/ccsv8/ATEIS AM335X/Source Code/Include/armv7a" -g --preproc_with_comment --preproc_with_compile --define=am3352 --define=ccs --define=AM335X --define=_FUNCTION_PERFORMANCE_xx --diag_warning=225 --diag_wrap=off --display_error_number --neon --enum_type=int --wchar_t=16 -k --c_src_interlist --obj_directory="Middleware" "../Middleware/DNM_Channel.c"
Finished building: "../Middleware/DNM_Channel.c"
edit:
quoted from ARM System Developers Guide-Designing and Optimizing System Software again.
I guess the reason for abort is that address 0x803657D2+8 is not a multiple of four bytes.
But why compiler doesn't allocate this variable to address multiple of 4? I didn't specify packed to the struct, and therefore it should be address of multiple 4.