Stuff error and Form error at the CANoe

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

Stuff error and Form error at the CANoe

38,070件の閲覧回数
kimjunghyun
Contributor III

Hi.

I have been trying to transmit CAN message but there have been 2 errors. Stuff error and Form error.

- message transmission : MCU -> Transceiver : error (I think) ,

                                         Transceiver -> CANoe : 2 errors(Stuff error, Form error)

What would be a problem?

 

■ MCU TX (PTC7, pin 51) : error (refer to yellow and red color)

178085_178085.bmpmcu_TX.bmp

 

■ Transceiver CAN high(pin 7) : error (refer to yellow and red color)

178086_178086.bmpTRK_CANHigh.bmp

 

 ※ Other item of my company :

      - CAN frame is transmitted correctly (refer to yellow color which is CAN high at Transceiver)

      - You can see id, DLC, Data frame (refer to blue color)

178087_178087.bmp자사 아이템_CANhigh.bmp

 

■ Transceiver -> CANoe : 2 errors(Stuff error, Form error)

178059_178059.jpgCANoe2.jpg

178058_178058.jpgCANoe1.jpg

 

■ MCU : S32K144 (64pin)
  - CAN TX : 51pin (PTC7, CAN1_TX)
  - CAN RX : 52pin (PTC6, CAN1_RX)

 

■ Transceiver : TJA1057

 

■ Schematic (I attached it)

 - TRK-KEA 2014 Freescale

178029_178029.jpgsche.jpg

 - 8pin : connected to ground (set to low level)

 - 5pin : originally connected as above but now I opened this pin to check whether to work

 

■ Code (I attached it)

 

CLOCK_SYS_Init(g_clockManConfigsArr, FSL_CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, FSL_CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_FORCIBLE);

 

PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

 

FLEXCAN_DRV_Init(FSL_CANCOM1,&canCom1_State, &canCom1_InitConfig0);

FLEXCAN_DRV_ConfigTxMb(FSL_CANCOM1, MB, &dataInfo, MSG_ID);

 

for(;;)
{

    if(GPIO_HAL_ReadPins(PTD)>>0==1)
    {
     GPIO_HAL_ClearPins(PTC,1<<1);
     FLEXCAN_DRV_Send(FSL_CANCOM1, MB, &dataInfo, MSG_ID, &toggleLED);

    }

    if(GPIO_HAL_ReadPins(PTD)>>0==0)
    {
     GPIO_HAL_SetPins(PTC,1<<1);
    }
}

 

■ And some questions

1. Can a clock configuration be a problem?

2. I need a code that transmit a message only one time

3. I checked the example project - CAN MASTER example. But CAN frame was not transmitted.

  - While this project was being executed, 'SendCANData()' was executed but CAN frame was not transmitted.

  - measured point : PTE(5) - CAN0_TX

  - package : I set both 100pin and 64pin but all that was not executed.

  - debuging picture (digital input works correctly. CAN transmission does not work)

178088_178088.jpgCAN_MASTER_Example 디버깅 화면.jpg

Original Attachment has been moved to: 2017_2_21.zip

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

21,880件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

It looks the bit timing is not properly set.

With the same scope setting (time base) the bit time is at least 2 timer longer on first 2 pictures then or the 3rd.

How do you set the CAN bit timing in your project? I do not see any.

In the CAN MASTER example it is set in this way to get 500kbit/s using 8MHz as PE clock

pastedImage_1.png

 

BR, Petr

0 件の賞賛
返信

21,880件の閲覧回数
kimjunghyun
Contributor III

Hi.


CAN bit time is 500kbit/s.

Please refer to below.

- Module clock and PE clock are 0Hz.

Project_CAN_clock_config1.jpg

Project_CAN_clock_config2.jpg

As you pointed above, I made a new other project and switched package from 100pin to 64pin first

I checked clocks and it was ok.

And then I added digital input and output which worked well.


But when I added [fsl_flexcan], FlexCAN0 clock and FlexCAN1_clock were 0Hz.

* Module clock and PE clock were 0Hz too.


So I switched package from 64pin to 100pin and I confirmed CAN related clocks were ok.

And again I switched back package from 100pin to 64pin and CAN related clocks were ok.

But digital input and output did not work. Of course CAN did not work

What should I check?


Thank you.

Kim.

0 件の賞賛
返信

21,880件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

You should configure both the Module and PE clock properly in fsl_clock_manager component.

 

You can open it e.g. from CAN component’s “Shared components” tab

 pastedImage_1.png

And enable SOSCDIV2 from SOSC setting

 pastedImage_2.png

And also be sure CAN0 module clock is enabled in PCC setting

 pastedImage_3.png

BR, Petr

0 件の賞賛
返信

21,880件の閲覧回数
kimjunghyun
Contributor III

I configured as above but CAN frame did not trasmitted.

This code worked well before I added CAN related code including CAN related configuration on Component Inspector.

But after I added CAN related code, this code did not work any more.

This code stoped at function [FLEXCAN_HAL_Enable()]. refer to following picture.

디버깅시 계속 돌고있는 코드.jpg

Thank you.

Kim.

0 件の賞賛
返信