Not able to trasmit CAN message from S32K144 board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Not able to trasmit CAN message from S32K144 board

4,138 Views
mrajanna
Contributor V

Hi Elites,

I have CAN emulator(gridconnect USB/CAN adapter) connected to S32K144 board as in below picture.

For your information: I am running S32K144_CAN_SLAVE_Example application on board.

pastedImage_1.png

I am able to send CAN message from emulator to S32K144. Even LED is toggling on the board, it is receiving CAN messages. 

pastedImage_2.png

But I am unable to send CAN messages from board to emulator i.e, When I press button on board, it seems board should send CAN message but emulator is observing stuff error as in below picture.

pastedImage_4.png

Any suggestion please, why board is not able to send CAN messages ?

Thanks

Mohan

0 Kudos
13 Replies

2,689 Views
yexie
Contributor I

hi,Mohan:

      can you tell me some details about it?how to change the time setting?

0 Kudos

2,689 Views
mrajanna
Contributor V

Hi,

Can you please check FlexCAN sample example in S32 Design studio. It will work for both sending and receiving CAN messages.

Thanks

Mohan

0 Kudos

2,689 Views
frankzeng
Contributor I

Hi MoHan,

Can you supply your correct configuration sample!

Thanks,

Frank

0 Kudos

2,689 Views
yexie
Contributor I

hi,Mohan:

        Have you solved this problem?I met it the same to u.Evenmore ,I amnot able to send CAN message from emulator to S32K144, neither.

        wait for you reply.

thanks

Ean

0 Kudos

2,689 Views
mrajanna
Contributor V

Hi Ean,

Yes problem is solved for me. It was problem with clock setting.

Thanks

Mohan

0 Kudos

2,689 Views
martin_kovar
NXP Employee
NXP Employee

Hello Mohan,

could you please check timing settings? At the first sight it looks like timing error.

Regards,

Martin

0 Kudos

2,689 Views
mrajanna
Contributor V

Hi Martin,

Please see bit rate timings. This is captured during debugging.

pastedImage_1.png

Thanks

Mohan

0 Kudos

2,689 Views
martin_kovar
NXP Employee
NXP Employee

Hello Mohan,

and what are the timing settings you use in your USB/CAN tool?

Could you please measure the CAN bus when you send data from microcontroller and send me the screen?

Also, could you please send me the screen of USB/CAN tool receive message settings?

Regards,

Martin

0 Kudos

2,689 Views
mrajanna
Contributor V

Hi Martin,

I am using 500 kBit/s time setting. Please see below screenshot.

With this setting, sending of CAN message to board(S32K144 EVB) from USB/CAN tool is successful.

pastedImage_1.png

There is problem only when CAN message is sent from board to USB/CAN tool. Below screenshot for reference.

pastedImage_2.png

I am running below example on board.

pastedImage_3.png

Thanks

Mohan

0 Kudos

2,689 Views
martin_kovar
NXP Employee
NXP Employee

Hello Mohan,

your timing settings set in FlexCAN module seems to be strange. Please use the settings below:

CAN0->CTRL1 = 0x00DB0006; /* Configure for 500 KHz bit time */
                            /* Time quanta freq = 16 time quanta x 500 KHz bit time= 8MHz */
                            /* PRESDIV+1 = Fclksrc/Ftq = 8 MHz/8 MHz = 1 */
                            /*    so PRESDIV = 0 */
                            /* PSEG2 = Phase_Seg2 - 1 = 4 - 1 = 3 */
                            /* PSEG1 = PSEG2 = 3 */
                            /* PROPSEG= Prop_Seg - 1 = 7 - 1 = 6 */
                            /* RJW: since Phase_Seg2 >=4, RJW+1=4 so RJW=3. */
                            /* SMP = 1: use 3 bits per CAN sample */
                            /* CLKSRC=0 (unchanged): Fcanclk= Fosc= 8 MHz */

Regards,

Martin

0 Kudos

2,689 Views
mrajanna
Contributor V

Hi Martin,

On MCU side I made your changes. Below screenshot for reference.

pastedImage_2.png

Still I am only able to send CAN message from USB/CAN tool to MCU.

But I am not able to send CAN message from MCU. Below screenshot observed on PCAN view.

pastedImage_1.png

0 Kudos

2,689 Views
martin_kovar
NXP Employee
NXP Employee

Hello Mohan,

unfortunately, I do not have USB/CAN adapter to check on my side. I can only recommend you to use second S32K board and try the communication between two boards.

Regards,

Martin

0 Kudos

2,689 Views
mrajanna
Contributor V

Hi Martin,

How do I check timing settings ?, can you please elaborate more on this.

Thanks

Mohan

0 Kudos