Can Message Transmitting but Not being Received

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

Can Message Transmitting but Not being Received

ソリューションへジャンプ
2,306件の閲覧回数
pb632146
Contributor V

I converted the CAN_EXAMPLE_S32k344 to run in normal mode, but despite the oscilloscope showing a can transmission waveform it is not being picked up by a can485 board from adafruit I am using as a receiver. https://learn.sparkfun.com/tutorials/ast-can485-hookup-guide/all#example-simple-can-network

The blocking send always just times out.

Can someone look at the waveforms I have and tell me what is wrong? I changed the message Id to 200 but I don't think that should break anything. Have I set my segments wrong? I dont know how exactly I am supposed to distribute it just that I am working on 250k bps

canbus high

Canbus high.bmp

 canbus low

canbus low.bmp

output from oscilloscope

pb632146_0-1733734736151.bmp

flexcan settings and baud rate

pb632146_1-1733734910984.png

pb632146_2-1733734926469.png

 

 

 

 

0 件の賞賛
返信
1 解決策
2,136件の閲覧回数
pb632146
Contributor V

It appeared to be a clock issue as editing the protocol clock to 16mhz instead of 24mhz (I have a 16mhz oscillator connected so I assume this was the issue), and adjusting the segments fixed it

 

pb632146_0-1734097429050.png

 

元の投稿で解決策を見る

10 返答(返信)
2,283件の閲覧回数
RomanVR
NXP Employee
NXP Employee

Hi @pb632146.

As per your explanation, it seems that your S32K344 as transmitter is working just fine, therefore I would suggest to check on your receiver device or circuitry given that the transmitter is indeed generating an output signal.

Note: If you would like to test if your CAN module is working correctly, you can run an example code on your EVB (Evaluation Board) where you can use a "loopback" function, which makes the CAN module send information to its own receiver.

- RomanVR.

 

Best Regards!
0 件の賞賛
返信
2,277件の閲覧回数
pb632146
Contributor V

As a clarification I am using a 342 board so I had to edit the code a bit but also its it own transceiver which doesnt need to be enabled like the one on the 344evb. https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005991B...

The sparkfun board receiver does work when I use another of the same board, but does not pick up the can messages from my 342 board, despite using the same transceiver.

 

Are there any considerations I might be missing trying to send a can message between this and the arduino code?

What do classic can/can fd mean relative to can 2.0a and can 2.0b? Are there specific settings to choose one or another in either the peripherals tab or the code itself?

0 件の賞賛
返信
2,270件の閲覧回数
pb632146
Contributor V

I forgot to actually upload the code

0 件の賞賛
返信
2,267件の閲覧回数
pb632146
Contributor V
Also it works in loopback which is why am I confused I am having so much trouble converting it to normal mode
0 件の賞賛
返信
2,238件の閲覧回数
pb632146
Contributor V
Sorry Flexcan_example_s32k344 not can_example

And what is flexcan vs can2.0 vs classic can

I hooked up another of the same s32k342 board I have as a receiver and it is receiver properly so I can conclude there is some issue in the sparkfun receiver, but I do not think it is a board issue as it receives from others fine. So how do I tell what form of can message I am actually sending?
0 件の賞賛
返信
2,200件の閲覧回数
RomanVR
NXP Employee
NXP Employee

Hi @pb632146 

Thank you for confirming that your FlexCan Driver is working properly.

FlexCAN is a communication controller implementing the CAN protocol according to the ISO 11898-1:2015 standard and CAN 2.0 Part B protocol specifications. For more detailed information, I suggest referring to Chapter 73 (CAN (FlexCAN)) of the S32K3xx Reference Manual, Rev. 9. 
Additionally, I recommend reviewing the S32K3 CAN_43_FLEXCAN Driver Integration Manual and the User Manual included with the RTDs. These documents provide detailed information about the driver, including its limitations, hardware and software requirements, usage instructions, and configuration guidelines. They will be helpful for gaining a deeper understanding of the driver's functionality. You can find these resources at the following location:

C:\NXP\SW32K3_S32M27x_RTD_4.4_4.0.0_P24\eclipse\plugins\Can_43_FLEXCAN_TS_T40D34M40I0R0\doc

Or

C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32K3\RTD\Can_43_FLEXCAN_TS_T40D34M30I0R0\doc

- RomanVR

Best Regards!
0 件の賞賛
返信
2,186件の閲覧回数
pb632146
Contributor V

So from reading the User manual is it possible that my time segments are wrong? I only focused on getting the bitrate to 250k. Bitrate and baud rate are synonymous for CANbus?

pb632146_1-1733882116103.png

 

pb632146_0-1733882078664.png

pb632146_2-1733882160178.png

 

It appears from this  my time segment 1 would be 15 while my time segment 2 is only 3. Figure 404 is the correct bit time segment figure for Can 2.0B as it says "Classical CAN format (Bosch CAN 2.0B)" meaning classic can and can 2.0b are synonymous correct?

 

additionally if I only want to be sending "Can protocol specification, version 2.0B" and not 
"Can with flexible data rate(can fd)" then I would leave all the boxes here unchecked, unlike my original post correct? I do not know if 2.0b is the default or not but assume the enabling FD can may introduce some errors if I do not know how to use it.

pb632146_3-1733882285121.png

 

 

0 件の賞賛
返信
2,182件の閲覧回数
pb632146
Contributor V
If the issue is indeed the time segments that is the issue, is there any recommendation of time segments or consideration for time segment sizes? Is there a way to look at how the MCAL modules set it up to copy as opposed to manually setting these values myself?
0 件の賞賛
返信
2,148件の閲覧回数
RomanVR
NXP Employee
NXP Employee

Hi @pb632146 

 To help you verify if your configurations meet the requirements of your receiver device, I have attached to this message a guide that provides a deeper understanding of the configuration parameters of the FlexCAN module, as well as the limitations to consider.

This document can be found at: S32K3 Training.

- RomanVR.

Best Regards!
0 件の賞賛
返信
2,137件の閲覧回数
pb632146
Contributor V

It appeared to be a clock issue as editing the protocol clock to 16mhz instead of 24mhz (I have a 16mhz oscillator connected so I assume this was the issue), and adjusting the segments fixed it

 

pb632146_0-1734097429050.png