AnsweredAssumed Answered

A fatal error with CCES

Question asked by chrischen on Mar 25, 2013
Latest reply on Mar 29, 2013 by chrischen

  hi,

          I just ported code to CCES and compliled it. but  A fatal error or exception has occurred. I have found where the error occurr. It cast a variable type from  uint8_t to uint16_t. I have attached the code below.

 

 

typedef union {

               struct {

                         uint8  socketType[2]; //@ 0=TCP Client, 1=UDP Client, 2=TCP Server (Listening TCP)

                        uint8  moduleSocket[2]; //@ Our local module port number

                         uint8  destSocket[2];//@ Port number of what we are connecting to

                         uint8  destIpaddr[4]; //@ IP address of socket we are connecting to

                         uint8  padding[2];

          } socketFrameSnd;

               uint8    uSocketBuf[12];   //@ 12 bytes, byte format to send to spi

} rsi_uSocket;

 

*(uint16 *)ptrStrApi->uSocketFrame.socketFrameSnd.moduleSocket = 5001; (when it falls through to this statement, it will occurr the error)

 

the fatal error:

     A fatal error or exception has occurred.

       Description:   Attempted misaligned data memory or data cache access (Exception with EXCAUSE=0x24).

       General Type:  UnhandledException

       Specific Type: DataMisalignedAccessViolation

       General Code:  0x9

       Specific Code: 0x24

       Error Value:   0x00130024

       Error PC:      0xffa024f8

 

     Thanks!

Outcomes