CAN 250kbps device returns bad

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

CAN 250kbps device returns bad

Jump to solution
1,603 Views
nishantsood
Contributor III

Hi Guys,

I have this S32k developer EVB evaluation kit using which I'm trying to talk to a 250Kbps bit rate CAN device on the CAN bus.

Connection:

There are only 2 devices on the whole CANbus 1) The s32k EVB and, 2) The other CAN device which Im trying to read.

I'm skeptical on 2 things:

1) My bitrate calculation:

.bitrate = { // 80 /( [(1 + (4+1) + (1+1) + (7)] x (1+1)) = 80 / ([15] x 2) = 80/30 = 2.6Mhz
.propSeg = 126, // Fcanclk /( [(1 + (15+1) + (15+1) + (127)] x (1+1)) = 80/ [( 40+50+70) x 2]] = 80/320 = 
.phaseSeg1 = 15,
.phaseSeg2 = 15,
.preDivider = 1,
.rJumpwidth = 1
},

and,

2) The mailbox addresses:

#if defined(MASTER)
#define TX_MAILBOX (1UL)
#define TX_MSG_ID (0x01de0800UL)
#define RX_MAILBOX (2UL)
#define RX_MSG_ID (0x01df0900UL)

I'm reading, but I'm not getting the correct replys. As I have tested it before with an Arduino , on it I get all data correctly (extended identifier based call backs)

Tags (2)
1 Solution
1,206 Views
AnaAldescu
NXP Employee
NXP Employee

Hello,

You can see the graphical interface in "Component Inspector" view

pex_config.PNG

If you cannot see this view by default, please access Window > Show view > Other > Processor Expert > Component Inspector.

From this view you can generate the user configuration structure for the FlexCAN driver.

pex_user_config.PNG

For any other information regarding the FlexCAN example (how to enable/disable encryption, etc.), please read the example documentation.

Regards,

Ana

View solution in original post

4 Replies
1,207 Views
AnaAldescu
NXP Employee
NXP Employee

Hello,

You can see the graphical interface in "Component Inspector" view

pex_config.PNG

If you cannot see this view by default, please access Window > Show view > Other > Processor Expert > Component Inspector.

From this view you can generate the user configuration structure for the FlexCAN driver.

pex_user_config.PNG

For any other information regarding the FlexCAN example (how to enable/disable encryption, etc.), please read the example documentation.

Regards,

Ana

1,206 Views
nishantsood
Contributor III

Thank you!, Ana.

Let me try the solution.

0 Kudos
1,206 Views
AnaAldescu
NXP Employee
NXP Employee

Hello,

Are you using the S32 SDK FlexCAN driver with S32 Design Studio? If so, you could use the bitrate calculator from the graphical interface.

Also, please provide the clock source for the Protocol Engine clock and its frequency.

Regards,

Ana

1,206 Views
nishantsood
Contributor III

Hi Ana,

Yes, I'm using the S32 Design Studio. Please, let me know from where to access this graphical tool for bitrate calculation!?

Also, I'm using the flexcan_encrypted example as the basis for my project. (although, I'm not using any encryption!)

The clock settings are as follows:

pastedImage_1.png

0 Kudos