This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358: PRU-CGT 2.3.3 crashes

Part Number: AM3358

Hi,

when compiling some code for the PRU of the AM3358, the compiler crashes:

INTERNAL ERROR: optpru experienced a segmentation fault
 while processing function main file /tmp/TI0LRs1EyhN

This is caused by a defect in the TI C/C++ Optimizer.
TI Customer Support may be able to suggest a workaround to avoid this.

The funny thing here: when I add the option "--preproc_with_comment" to the compiler call, the issue is gone and the crash does not happen any more.

What I have added last to my code and which seem to be related to that issue is the following macro:

#define SEND_LOGIC1_CELL  \
{ \
   uint32_t reg; \
   if (*state1==0) \
   { \
      reg=SL1_BIT; \
   } \
   else \
   { \
      reg=0; \
   } \
   if (*state2==0) \
   { \
      reg|=SL2_BIT; \
   } \
   else \
   { \
      __delay_cycles(1);  \
   } \
   __R30=reg; \
   if (*state1==1) \
   { \
      reg=SL1_BIT; \
   } \
   else \
   { \
      reg=0; \
   } \
   if (*state2==1) \
   { \
      reg|=SL2_BIT; \
   } \
   *pCtr1=*pCtr1+1; \
   *pCtr2=*pCtr2+1; \
   __delay_cycles(P0_CLOCK_CYCLES+2); \
   __R30=reg; \
}

So that works for me right now, but may be this is an issue somebody at TI is interested in...