cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F427 CAN Data Check

john239955_st
Associate III
Posted on February 13, 2017 at 16:30

I am currently running CAN1 and CAN2 on the F427 and need to check/validate the Transmitted Data.

Both CAN1 and CAN2 function correctly.

I wish to Transmit Data on CAN1 and, if possible, Receive the sent Data in the Receiver of CAN1 module.

For test I have connected CAN1 and CAN2 onto a single Bus and can Transmit on CAN1 and Receive on CAN2 OK but limits my application.

Is it possible to Send and Receive into the same Module i.e. CAN1.

Any help would be appreciated.

Thanks John W

9 REPLIES 9
Posted on February 13, 2017 at 17:02

>>

Is it possible to Send and Receive into the same Module i.e. CAN1.

Yes, but the case where you are sending the data would seem to be one where receiving that same data seems pointless. It expects to get an acknowledgement from the far end receiver.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
john239955_st
Associate III
Posted on February 13, 2017 at 17:39

Thanks Clive,

The End Receiver, for test, purposes is a Peak PCAN unit.

I am looking to check if at sometime between the loading of the ID/Data and transmission, if there has been a corruption due to Noise or Power Supply spike etc.

Do you know if the Data sent from the CAN1 module also appears in the CAN1 Receive module as well as the End Receiver(Peak).

Thanks for your help. KR John W

john239955_st
Associate III
Posted on February 13, 2017 at 19:41

Thanks Clive,

When I send data on CAN1  I do not get a CAN1 Receive Interrupt which makes me think the Receive buffer does not receive data .... Will have a furthur poke around.

Thanks for your help ... Past and Present.  KR John W

Posted on February 13, 2017 at 19:23

>>

Do you know if the Data sent from the CAN1 module also appears in the CAN1 Receive module as well as the End Receiver(

I don't think it does, if the integrity of the packet fails the CRC would be wrong, and the bus would resend it, right? The input side of the CAN is monitoring the signal as it goes out, that's how the contention stuff functions, but I don't believe it receives that data into a buffer.

Looking at the signalling at the local end isn't really as helpful as looking at it at the far end of the cable. Having it come back as a long loop to CAN2 would seem to be a better means of evaluating signal integrity on the bus.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
T J
Lead
Posted on February 13, 2017 at 22:39

HI,

I purchased a CanDo unit from the UK.

I was able to initialize, receive huge amounts of packets at 10mS and still transmit without error.

this seems t be an excellent tool that can easily get the bus bandwidth to over 70% utilization.

You can see there is the odd error, but the CanBus protocol hardware recovers instantly.

________________

Attachments :

CanDo screen.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyin&d=%2Fa%2F0X0000000bDz%2FO26lwfpb4TcDxXmzo8AL.Fbylx4QjS5PZC9TvD088IU&asPdf=false
valentin
Senior
Posted on February 14, 2017 at 02:34

White.John

‌, I think what you're after is loopback mode.

If you set your can module to loopback, it will receive all its sent messages in parallel (and fire the corresponding Rx Interrupts, etc).

This also means that it's acknowledging its own messages (I think) and therefore it's no good if you want to see whether the other nodes on the bus act correctly.

Also, it doesn't give you anything on signal integrity. It's more a simulation of a received message.

john239955_st
Associate III
Posted on February 14, 2017 at 11:03

Thanks Nick,

I have used Peak PCAN for some years and this seems to work OK, but thanks for the tip.

Also Thanks Valentine,

The Loopback Mode seems to disconnect CAN IN and connect Out to IN and as you say this is a test mode and possibly not suitable.

I think Clive's comments are valid in as much that the Data put onto the Network if read by CAN2 module and validated this seems to be a bit more robust.

Thanks all for your help. KR John W

Posted on February 14, 2017 at 20:23

Also Thanks Valentine,

The Loopback Mode seems to disconnect CAN IN and connect Out to IN

That's correct - if you want normal operation AND listen to what you're transmitting, you'd have to have a 2nd node on the bus that does the listening part for you.

john239955_st
Associate III
Posted on February 15, 2017 at 10:23

Thanks Valentine ... That makes sense ... Think I may need a 3/4 CAN Node STM32F4xxx.

Once again Thanks to All .... John W.