AnsweredAssumed Answered

Problem with Flexcan2 and Flexcan3 in spc560b50L5

Question asked by vanima.nooshin on Mar 14, 2015
Latest reply on Mar 19, 2015 by Erwan Y
Hi
I have a 3channel can board for my project , i work with Flexcan1 with out any problem but when i want to work with Flexcan2 or 3 with a same config they did not work or any action.
here is my code :

automatically.*/

#include"components.h"

#include"can_lld_cfg.h" </p>

 

</b>

 

  

#define led1 SIU.GPDO[102].B.PDO
#define led2  SIU.GPDO[103].B.PDO
#define led3 SIU.GPDO[105].B.PDO
#define FM SIU.GPDO[69].B.PDO
#define CAN_EN SIU.GPDO[71].B.PDO

#defineASSR_EN SIU.GPDO[44].B.PDO </p>

 

</b>

CANTxFrame  txmsg;
int main(void)
{
    
componentsInit();
      osalIsrEnable();

 

 

canStart(&CAND3,&can_config_canls);

SIU.

PCR[102].B.OBE=1;

SIU.PCR[103].B.OBE=1;
SIU.PCR[105].B.OBE=1;
SIU.PCR[69].B.OBE=1;
SIU.PCR[71].B.OBE=1;
SIU.PCR[44].B.OBE=1;
SIU.PCR[42].B.PA=1;
SIU.PCR[42].B.OBE=1;
SIU.PCR[43].B.IBE=1;
SIU.PCR[35].B.PA=0;
SIU.PCR[35].B.OBE=1;
SIU.PCR[95].B.PA=0;
SIU.PCR[95].B.OBE=1;

 txmsg.IDE = CAN_IDE_STD;
txmsg.RTR = CAN_RTR_DATA;
txmsg.LENGTH = 8;
txmsg.data32[0] = 0x55AA55AA;
txmsg.data32[1] = 0x00FF00FF;

////////////////////

 

led1 = 1;
led2 = 1;
led3 = 1;
FM = 1;
CAN_EN=1;
ASSR_EN=1;

/* Application main loop.*/
while (1){

CAND2.flexcan->BUF[2].CS.B.IDE=0U;
CAND2.flexcan->BUF[2].CS.B.RTR=0U;
CAND2.flexcan->BUF[2].ID.B.STD_ID=0x325;
CAND2.flexcan->BUF[2].CS.B.LENGTH=7;
CAND2.flexcan->BUF[2].DATA.B[0]=0x89;
CAND2.flexcan->BUF[2].DATA.B[1]=0x66;
CAND2.flexcan->BUF[2].DATA.B[2]=0x77;
CAND2.flexcan->BUF[2].DATA.B[3]=0x44;
CAND2.flexcan->BUF[2].DATA.B[4]=0xee;
CAND2.flexcan->BUF[2].DATA.B[5]=0xaa;
CAND2.flexcan->BUF[2].DATA.B[6]=0xbb;
CAND2.flexcan->BUF[2].CS.B.CODE=0X0C;
led2 = ~led2;

osalThreadSleepMilliseconds(500);

}

}


i use the SPCStudio function's but get the same answer
Please Help About this issue

Thanks
Best Regards Vanima

Outcomes