Forums - Problem with misaligned load

9 posts / 0 new
Last post
Problem with misaligned load
phalgunb
Join Date: 6 Oct 14
Posts: 18
Posted: Mon, 2014-11-10 01:36

hello,

I have a function with arguments of Word16 type. But in order to load Word32 type i have changed the function and i get the following misaligned load error.

CRASH from thread 0!
I think the exception was: Error, cause:Misaligned Load @ 0x3d0f2
Register Dump (r0 and tid were clobbered):
r00=000000cd r01=0003d168 r02=ffffffc4 r03=fffffff9
r04=00000001 r05=0003f120 r06=00000020 r07=0000167e
r08=00000003 r09=00000002 r10=00000000 r11=fffff7bc
r12=fffffb26 r13=00000001 r14=0003c5ac r15=0000346a
r16=0003b754 r17=0003ba20 r18=00008000 r19=0000170a
r20=00037da2 r21=00037daa r22=00037bd2 r23=00037bda
r24=00037c12 r25=00037d62 r26=00037d6a r27=00037cb2
r28=00037bd2 r29=0413fd10 r30=04140068 r31=00007bc4
sa0=0001cb58 lc0=00000020 sa1=00000000 lc1=00000000
p30=0000ff00  m0=00000000  m1=00000000  sr=00010001
 pc=00000894 ugp=00000000
sgp=00001220 ssr=00740020 imask=00000000 badva=0003d0f2
elr=0001cb74 tid=00000002
evb=00004000 ipend=00000000 syscfg=0081007f modectl=00000001
This error occurs when i try to run the application. But the build is successful
Please help me out with this.
 
regards,
phalgun
  • Up0
  • Down0
jmay Moderator
Join Date: 11 Sep 13
Posts: 34
Posted: Mon, 2014-11-10 10:39

Have you analysed your code to identify where the misaligned load may be coming from?

Have you tried using the remote debugger to step through your code to help identify where the issue is coming from?

Thanks,

Jack

  • Up0
  • Down0
phalgunb
Join Date: 6 Oct 14
Posts: 18
Posted: Tue, 2014-11-11 22:15

hi,

Yes I have analysed. The intermediate operations causes the misalignment. Since the intermediate operations cannot be changed. I have no other option other than to proceed with the Word16 type.

Thanks,

phalgun

  • Up0
  • Down0
sambley
Join Date: 14 Nov 14
Posts: 2
Posted: Fri, 2014-11-14 10:06

Could you post the code snippet of the function and the instruction where you are seeing the exception happening?

Thanks

Sathish

  • Up0
  • Down0
phalgunb
Join Date: 6 Oct 14
Posts: 18
Posted: Sat, 2014-11-22 03:22

sorry for the late reply the problem is when i run normally i get the error but when i am trying to debug. the problem is not there.

regards,

phalgun

  • Up0
  • Down0
jmay Moderator
Join Date: 11 Sep 13
Posts: 34
Posted: Mon, 2014-11-24 14:06

How are you trying to debug?  If via FARF, could it be someting with how you call FARF?

Were you planning to post a code snippet?

  • Up0
  • Down0
phalgunb
Join Date: 6 Oct 14
Posts: 18
Posted: Mon, 2014-11-24 23:15

the function is as follows

func(int a[],int *b,int c, int d)

{

        int e= a[-c];d=-d;

       if(d<0)

     {

         d=d+4;

         e--

      }

       b=b+(3-d);

............................

.............................

}

the base pointer address chnges. i have written this in assembly. so when i use -g3 flag it works. if i donot use -g3 and run it normally it says there is some misaligned load.

  • Up0
  • Down0
sambley
Join Date: 14 Nov 14
Posts: 2
Posted: Mon, 2014-12-01 10:18

Hi Phalgun,

You had mentioned that the arguments is of word16 type but dont see any arguments of this type in the pasted code.If it's possible to provide the actual snippet of assembly code where you are experiencing the problem, that would be helpful.

 

Thanks

Sathish

  • Up0
  • Down0
ajayhrrao
Join Date: 27 Nov 16
Posts: 12
Posted: Fri, 2016-12-23 03:47

hi all,

i am using SDK 3.0 for optimizing DTMF detection. i have written goertzel algorithm using assembly. when the optimization level is -O0 it runs fine. but when i changes to -O3 it shows misaligned load at 0xdd.

regards,

ajay

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.