MM9Z1_638 CAN receiver error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MM9Z1_638 CAN receiver error

2,206件の閲覧回数
baji
Contributor I

We are working with CAN transmission on MM9Z1_638 with demo board RD9Z1_638_4Li Rev 1.2, We establish CAN communication between MM9Z1_638 and MICROCHIP CAN analyzer with demo code (RD9Z1_638_12VLA_CAN_demo). The data is transmitting from MM9Z1_638 to CAN analyzer is ok and receiving data from CAN analyzer to MM9Z1_638 is not getting and it is showing OVERRUN problem. Please help me to sort of this error.

Here i am attching the receiving code in demo code

// read message object .....
(void) Check_CAN_MB_Status(CAN0, CANBUF3, &mbStat);
if(mbStat.Status == NEWDATA)
{ //Wait for the Receive ISR to finish and change the buffer status, NEWDATA indicates that the buffer has receive a new data

err_status = Read_CAN_MB_Data(CAN0, CANBUF3, CAN_IBS_Control.byte);//Copy the received data in msCAN channel 0 buffer 2 to data_rec;
CAN_IBS_Control.u16Var = u16Swap(CAN_IBS_Control.u16Var);
mbStat.Status = NODATA; //Clear buffer_status[0]
//err_status = Read_CAN_MB_Data(CAN0, CANBUF3, rec_data);

if(CAN_IBS_Control.u16Var&0x8000) { // Goto Sleep Request
// goto sleep
err_status = Sleep_CAN(CAN0, CMPTX); // request CAN channel 0 go to sleep with completing transmission scheduled

do {
err_status = Check_CAN_Status(CAN0,CAN_status); // read the channel 0 status
}while (!(CAN_status[1]&SLPAK)); // wait till SLPAK bit set

B_PCR_WUEH_WUPTB4 = 1; // enable PTB4 wakeup
ADCDisable();
TsenseDisable();
B_GPIO_VSENSE = 0;

CAN_STDBY(STANDBYMODE);
PTA_PTA1 = 0;
PCREnterStopMode();

// .....zzzzzzzzzzz (stop mode)
// after wakeup the code continues to run here....
// but first the D2D Interrupt service routine will be run
B_WD_CTL = WD_OFF;
VsenseInit(&(vList[0]), &vListEntries, &(vValues[0]));
CsenseInit(&(cList[0]), &cListEntries, &(cValues[0]));
TsenseInit(&(tList[0]), &tListEntries, &(tValues[0]));
ADCInit();
CAN_STDBY(NORMALMODE);
}

if(CAN_IBS_Control.u16Var&0x1000) { // Goto Calib mode
Battery.tMode = BM_CALIBRATION;

CAN_IBS_Data.BatMode = Battery.tMode;
err_status = Load_CAN_MB(CAN0, CANBUF1, CAN_IBS_Data.byte);
err_status = Transmit_CAN_MB(CAN0, CANBUF1);

err_status = Config_CAN_MB (CAN0, 8, RXDF, 8);
err_status = Config_CAN_MB (CAN0, 9, TXDF, 9);
}
if(CAN_IBS_Control.u16Var&0x2000) { // Goto normal mode
Battery.tMode = BM_DRIVING;
VsenseInit(&(vList[0]), &vListEntries, &(vValues[0]));
CsenseInit(&(cList[0]), &cListEntries, &(cValues[0]));
TsenseInit(&(tList[0]), &tListEntries, &(tValues[0]));
ADCInit();
}
}

 

0 件の賞賛
返信
3 返答(返信)

2,180件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @baji,

I'm not familiar with the driver and this seems to be an application issue.

But the OVERRUN probably simply means the CANRFLG_OVRIF gets set.

Please refer to the datasheet, Section 6.13.4.2.3 Receive structures.

The code that you posted is polling the status of the can module by calling Check_CAN_MB_Status() in the main endless loop.

You are probably sending the CAN messages faster than the application can process it.

Can you send just one message from the CAN bus analyzer and check if it can receive it?

 

Regards,

Daniel

 

0 件の賞賛
返信

2,111件の閲覧回数
baji
Contributor I

I am working with CAN transmission on MM9Z1_638 with demo board RD9Z1_638_4Li Rev 1.2, We establish CAN communication between MM9Z1_638 and MICROCHIP CAN analyzer with demo code (RD9Z1_638_12VLA_CAN_demo). The data is transmitting from MM9Z1_638 to CAN analyzer is ok and receiving data from CAN analyzer to MM9Z1_638 is also working fine. But while working on power saving modes , i observed the below commands for sleep mode(CAN_IBS_Control.u16Var&0x8000), calibration mode(CAN_IBS_Control.u16Var&0x1000) & normal mode(CAN_IBS_Control.u16Var&0x2000) commands and Please help me to understanding these commands.

Here i am attching the code 

// read message object .....
(void) Check_CAN_MB_Status(CAN0, CANBUF3, &mbStat);
if((mbStat.Status == NEWDATA) || (mbStat.Status == OVERRUN)) { //Wait for the Receive ISR to finish and change the buffer status, NEWDATA indicates that the buffer has receive a new data

err_status = Read_CAN_MB_Data(CAN0, CANBUF3, CAN_IBS_Control.byte);//Copy the received data in msCAN channel 0 buffer 2 to data_rec;
CAN_IBS_Control.u16Var = u16Swap(CAN_IBS_Control.u16Var);
//Clear buffer_status[0]
//err_status = Read_CAN_MB_Data(CAN0, CANBUF3, rec_data);
err_status = Load_CAN_MB(CAN0, CANBUF1, CAN_IBS_Control.byte);
err_status = Transmit_CAN_MB(CAN0, CANBUF1);
mbStat.Status = NODATA;

if(CAN_IBS_Control.u16Var&0x8000) { // Goto Sleep Request
// goto sleep
err_status = Sleep_CAN(CAN0, CMPTX); // request CAN channel 0 go to sleep with completing transmission scheduled
do {
err_status = Check_CAN_Status(CAN0,CAN_status); // read the channel 0 status
}while (!(CAN_status[1]&SLPAK)); // wait till SLPAK bit set

//B_PCR_WUEH_WUPTB4 = 1; // enable PTB4 wakeup
ADCDisable();
TsenseDisable();
B_GPIO_VSENSE = 0;

CAN_STDBY(STANDBYMODE);
PTA_PTA1 = 0;
PCREnterStopMode();

// .....zzzzzzzzzzz (stop mode)
// after wakeup the code continues to run here....
// but first the D2D Interrupt service routine will be run
B_WD_CTL = WD_OFF;
VsenseInit(&(vList[0]), &vListEntries, &(vValues[0]));
CsenseInit(&(cList[0]), &cListEntries, &(cValues[0]));
TsenseInit(&(tList[0]), &tListEntries, &(tValues[0]));
ADCInit();
CAN_STDBY(NORMALMODE);
}

if(CAN_IBS_Control.u16Var&0x1000) { // Goto Calib mode
Battery.tMode = BM_CALIBRATION;

CAN_IBS_Data.BatMode = Battery.tMode;
err_status = Load_CAN_MB(CAN0, CANBUF1, CAN_IBS_Data.byte);
err_status = Transmit_CAN_MB(CAN0, CANBUF1);

err_status = Config_CAN_MB (CAN0, 8, RXDF, 8);
err_status = Config_CAN_MB (CAN0, 9, TXDF, 9);
}
if(CAN_IBS_Control.u16Var&0x2000) { // Goto normal mode
Battery.tMode = BM_DRIVING;
VsenseInit(&(vList[0]), &vListEntries, &(vValues[0]));
CsenseInit(&(cList[0]), &cListEntries, &(cValues[0]));
TsenseInit(&(tList[0]), &tListEntries, &(tValues[0]));
ADCInit();
}

0 件の賞賛
返信

2,093件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport
0 件の賞賛
返信