cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Flexcan2 and Flexcan3 in spc560b50L5

nooshin_1382
Associate II
Posted on March 14, 2015 at 19:51

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
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
3 REPLIES 3
Erwan YVIN
ST Employee
Posted on March 17, 2015 at 15:05

Hello Vanima ,

Did you configure your PADSEL Correctly ?

(Cf screenshot)

for FlexCan2 and FlexCan3 you should configure PADSEL1 and PADSEL2

Best regards

Erwan

________________

Attachments :

2015-03-17_145709.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyst&d=%2Fa%2F0X0000000bZj%2FdXeLa68hCgTfuRNFUnskok3H3ew8mWze.DB.Xmwzi0Q&asPdf=false
nooshin_1382
Associate II
Posted on March 19, 2015 at 11:47

Hello Erwan

I configure the PADSEL and everything is ok.

Thanks a lot , it is completely solved my problem and very usefull .

with Best Regards

Vanima
Erwan YVIN
ST Employee
Posted on March 19, 2015 at 17:26

Good news 

Erwan