Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mcp25xxfd: Errors during multiple ip link ups/downs #12

Open
engnfrc opened this issue Oct 2, 2019 · 3 comments
Open

mcp25xxfd: Errors during multiple ip link ups/downs #12

engnfrc opened this issue Oct 2, 2019 · 3 comments

Comments

@engnfrc
Copy link

engnfrc commented Oct 2, 2019

Hello,

I've started using the driver that you've written for the MCP25xxFD family and am having good luck with it so far. I edited the driver in a manner such that I can set the controller to Loopback and Listen-Only modes too. Right now I'm working on achieving auto-baud functionality at the application layer, I switch to Listen-Only mode and then every 5 seconds I switch to a new bitrate until I start receiving messages. The issue I'm running into is that if I allow this to run for too long then I get into a state that I can only recover from by restarting the RPi.

When I get into this unrecoverable state I have this message printed out from ip link:
RTNETLINK answers: Connection timed out

and if I check in dmesg I see an error like this:
Oct 2 13:05:24 rpi kernel: [65525.636197] mcp25xxfd spi0.0: Failed to switch to mode 2 in time
Oct 2 13:05:24 rpi kernel: [65525.636442] A link change request failed with some changes committed already. Interface can0 may have been left with an inconsistent configuration, please check.
Oct 2 13:05:25 rpi kernel: [65526.218801] mcp25xxfd spi0.1: Failed to switch to mode 2 in time
Oct 2 13:05:25 rpi kernel: [65526.218963] A link change request failed with some changes committed already. Interface can1 may have been left with an inconsistent configuration, please check.

Do you have any ideas on how to overcome this issue?

Is this a driver level issue? If so, how can I safely reload the driver without doing a restart? I tried the dtoverlay command, but that gives:
sudo dtoverlay -r mcp2518fd-click-can0
* Overlay 'mcp2518fd-click-can0' is not loaded
sudo dtoverlay mcp2518fd-click-can0 oscillator=40000000 spimaxfrequency=20000000 interrupt=6
* Failed to apply overlay '0_mcp2518fd-click-can0' (kernel)

Or is it a controller level issue? Would resetting the controller fix things? If so, what can I do to send the controller reset command from a higher-level application?

Thanks!

@engnfrc
Copy link
Author

engnfrc commented Oct 8, 2019

Just checking back in, is there anyone available to help me out with this question?

@engnfrc
Copy link
Author

engnfrc commented Oct 21, 2019

Also, any idea what could cause this error? I do not believe it's an SPI issue, as slowing down the clock frequency had not effect and over half the time the device performs just fine.

[263792.757403] mcp25xxfd spi1.0 can2: tefif: fifo 0 not pending - tef data: id: 00000000 flags: 00000000, ts: 00000000 - this may be a problem with spi signal quality- try reducing spi-clock speed if this can get reproduced

@engnfrc
Copy link
Author

engnfrc commented Oct 28, 2019

Using driver fixes from Issue #7 and #8, the error mentioned on Oct 21 appears to be remedied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant