cancel
Showing results for 
Search instead for 
Did you mean: 

SMTF32F1x CAN bus Error Frame

Dick Lin
Senior
Posted on February 17, 2017 at 18:54

Hi,

I am seeing Error Frame from one of our project using STM32F1x MCU. Any recommendation how to debug this issue?

Thanks,

Dick

112.227000 1 108 Rx d 8 db 1f c0 69 ee 89 e8 3e

112.227000 1 109 Rx d 8 86 31 94 43 00 00 00 00

112.227000 1 10a Rx d 8 00 00 00 00 6d 86 ec bf

112.228000 1 10b Rx d 8 00 00 00 00 04 00 00 40

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 6fe Rx d 8 00 49 82 56 53 29 39 16

112.229000 1 6fe Rx d 8 00 32 4e 38 37 86 23 21

112.229000 1 6fe Rx d 8 00 50 65 55 49 54 30 02
16 REPLIES 16
Oliver Beirne
Senior
Posted on February 20, 2017 at 04:46

Hello

I have moved your question to the

https://community.st.com/community/stm32-community/stm32-forum?sr=search&searchId=827a2a41-077c-4191-a4c1-9da6021f9aff&searchIndex=0

‌ where someone should be able to assist you.

Thanks

Oli

T J
Lead
Posted on February 20, 2017 at 05:12

How many nodes are on the Bus ?

is the bus terminated ?

Only one master can be on the bus. Do you have multiple masters ?

You need at least one slave too.

Posted on March 16, 2017 at 11:30

Are you meaning where to find the values of your error frames when debugging? 

Have you solved your question? I would like to see if it possible and find the register where this frames are kept and translated.

Dick Lin
Senior
Posted on March 16, 2017 at 23:15

I am using 1Mb/s baudrate. It's in a UAV device, so the cable length is short.

The error frame only can be seen on bus. I am using a CANTrace to capture the CAN message, CANTrace also record error frame. I do use Kvaser CanKing, it accumulate error frame count but not record in log file.

Dick Lin
Senior
Posted on March 16, 2017 at 23:46

It's battery-powered UAV. The whole system come with several subsystem, each one powered by a MCU and communicate with each other using CAN bus.

Unless I can change all of subsystem to other baudrate, otherwise it will error frame too - I think.

I think we don't have correct termination is the issue to have error frame. What I still can't prove is if the right termination will fix the issue. I have been tried couple of different termination already.

Thanks.

Dick Lin
Senior
Posted on March 16, 2017 at 23:56

Yes, I did that. That's why I know we are not correctly terminated. What I am not sure if the right termination actually fix the issue.

Posted on March 16, 2017 at 23:00

I think you are asking about hardware, not registers, so they are likely unavailable.

what baud rate are you running ?

what length of cable ?

are you using a real CanBus cable solution, or still on loopback ?

I received errors very occasionally at 250Khz on a true solution over a 10M cable with a 120 Ohm terminator at one end. (should be on both ends I know)

after a few minutes I may see an error, but usually when someone turns on a fan or light or fridge I guess.

The hardware recovers immediately, but it reports the error.

T J
Lead
Posted on March 17, 2017 at 00:32

yes, you really should match the impedance of the drivers to have half a chance of reducing errors.

are you using the CanBus filter ?

or

maybe you can get thicker power wires, the ground wire is most important.

put extra capacitance on your 5V rail,

can you feed power through an inductor or filter ?

Posted on March 16, 2017 at 23:34

is it electric or petrol based UAV ? either way, you will have noise issues.

I would say that you have noise on the line, so make sure both terminators are on, to reduce it.

Are you using isolated CAN modules ? it shouldn't be necessary if you have good grounding. 2-4mm wire between modules with good connections.

How are you generating the 5 volts ? .. it is likely your problem.

Power supplies seem to have many issues, solved by extra parts.

inductors and caps either side of the Switchers help, ferrites only stop noise above 2MHz

In my power supplies, I tend to go overboard, but the results are good.

do you need to go at 1Mhz ?

can you try 250KHz so see if the problem is resolved ?